mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Pull up emeter handling to tapodevice base class (#601)
* Pull has_emeter property up to tapodevice base class This will also use the existence of energy_monitoring in the component_nego query to decide if the device has the service. * Move emeter related functions to tapodevice * Remove supported_modules override for now This should be done in a separate PR, if we want to expose the available components to cli and downstreams * Dedent extra reqs * Move extra_reqs initialization * Fix tests
This commit is contained in:
@@ -7,7 +7,7 @@ import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
|
||||
import kasa
|
||||
from kasa import Credentials, DeviceConfig, SmartDevice, SmartDeviceException
|
||||
|
||||
from .conftest import device_iot, handle_turn_on, has_emeter, no_emeter_iot, turn_on
|
||||
from .conftest import device_iot, handle_turn_on, has_emeter_iot, no_emeter_iot, turn_on
|
||||
from .newfakes import PLUG_SCHEMA, TZ_SCHEMA, FakeTransportProtocol
|
||||
|
||||
# List of all SmartXXX classes including the SmartDevice base class
|
||||
@@ -35,7 +35,7 @@ async def test_invalid_connection(dev):
|
||||
await dev.update()
|
||||
|
||||
|
||||
@has_emeter
|
||||
@has_emeter_iot
|
||||
async def test_initial_update_emeter(dev, mocker):
|
||||
"""Test that the initial update performs second query if emeter is available."""
|
||||
dev._last_update = None
|
||||
|
Reference in New Issue
Block a user