mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-15 22:58:42 +00:00
Add emeter support for strip sockets (#203)
* Add support for plugs with emeters. * Tweaks for emeter * black * tweaks * tweaks * more tweaks * dry * flake8 * flake8 * legacy typing * Update kasa/smartstrip.py Co-authored-by: Teemu R. <tpr@iki.fi> * reduce * remove useless delegation * tweaks * tweaks * dry * tweak * tweak * tweak * tweak * update tests * wrap * preen * prune * prune * prune * guard * adjust * robust * prune * prune * reduce dict lookups by 1 * Update kasa/smartstrip.py Co-authored-by: Teemu R. <tpr@iki.fi> * delete utils * isort Co-authored-by: Brendan Burns <brendan.d.burns@gmail.com> Co-authored-by: Teemu R. <tpr@iki.fi>
This commit is contained in:
@@ -4,6 +4,7 @@ from unittest.mock import patch
|
||||
import pytest # type: ignore # https://github.com/pytest-dev/pytest/issues/3342
|
||||
|
||||
from kasa import SmartDeviceException
|
||||
from kasa.smartstrip import SmartStripPlug
|
||||
|
||||
from .conftest import handle_turn_on, has_emeter, no_emeter, pytestmark, turn_on
|
||||
from .newfakes import PLUG_SCHEMA, TZ_SCHEMA, FakeTransportProtocol
|
||||
@@ -26,7 +27,7 @@ async def test_initial_update_emeter(dev, mocker):
|
||||
dev._last_update = None
|
||||
spy = mocker.spy(dev.protocol, "query")
|
||||
await dev.update()
|
||||
assert spy.call_count == 2
|
||||
assert spy.call_count == 2 + len(dev.children)
|
||||
|
||||
|
||||
@no_emeter
|
||||
|
||||
Reference in New Issue
Block a user