From e5dd874333a17a41fa4833f593f0fe4c27e38c87 Mon Sep 17 00:00:00 2001 From: "Teemu R." Date: Mon, 11 Nov 2024 10:31:13 +0100 Subject: [PATCH] Update fixture for ES20M 1.0.11 (#1215) --- kasa/tests/fixtures/ES20M(US)_1.0_1.0.11.json | 20 +++++++++++-------- kasa/tests/test_dimmer.py | 3 +++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/kasa/tests/fixtures/ES20M(US)_1.0_1.0.11.json b/kasa/tests/fixtures/ES20M(US)_1.0_1.0.11.json index dd727236..f87a0a2b 100644 --- a/kasa/tests/fixtures/ES20M(US)_1.0_1.0.11.json +++ b/kasa/tests/fixtures/ES20M(US)_1.0_1.0.11.json @@ -44,6 +44,10 @@ ], "err_code": 0, "ver": "1.0" + }, + "get_current_brt": { + "err_code": 0, + "value": 16 } }, "smartlife.iot.PIR": { @@ -55,11 +59,11 @@ 0 ], "cold_time": 120000, - "enable": 0, + "enable": 1, "err_code": 0, "max_adc": 4095, "min_adc": 0, - "trigger_index": 1, + "trigger_index": 0, "version": "1.0" } }, @@ -71,7 +75,7 @@ "fadeOnTime": 0, "gentleOffTime": 10000, "gentleOnTime": 3000, - "minThreshold": 5, + "minThreshold": 17, "rampRate": 30 } }, @@ -88,9 +92,9 @@ "hw_ver": "1.0", "icon_hash": "", "latitude_i": 0, - "led_off": 0, + "led_off": 1, "longitude_i": 0, - "mac": "28:87:BA:00:00:00", + "mac": "B0:A7:B9:00:00:00", "mic_type": "IOT.SMARTPLUGSWITCH", "model": "ES20M(US)", "next_action": { @@ -98,7 +102,7 @@ }, "obd_src": "tplink", "oemId": "00000000000000000000000000000000", - "on_time": 0, + "on_time": 6, "preferred_state": [ { "brightness": 100, @@ -117,8 +121,8 @@ "index": 3 } ], - "relay_state": 0, - "rssi": -54, + "relay_state": 1, + "rssi": -40, "status": "new", "sw_ver": "1.0.11 Build 240514 Rel.110351", "updating": 0 diff --git a/kasa/tests/test_dimmer.py b/kasa/tests/test_dimmer.py index bf0d0c56..5d1d10e5 100644 --- a/kasa/tests/test_dimmer.py +++ b/kasa/tests/test_dimmer.py @@ -9,6 +9,7 @@ from .conftest import dimmer_iot, handle_turn_on, turn_on @dimmer_iot async def test_set_brightness(dev): await handle_turn_on(dev, False) + await dev.update() assert dev.is_on is False await dev.set_brightness(99) @@ -89,6 +90,7 @@ async def test_turn_off_transition(dev, mocker): original_brightness = dev.brightness await dev.turn_off(transition=1000) + await dev.update() assert dev.is_off assert dev.brightness == original_brightness @@ -126,6 +128,7 @@ async def test_set_dimmer_transition_to_off(dev, turn_on, mocker): query_helper = mocker.spy(IotDimmer, "_query_helper") await dev.set_dimmer_transition(0, 1000) + await dev.update() assert dev.is_off assert dev.brightness == original_brightness