Update fixture for ES20M 1.0.11 (#1215)

This commit is contained in:
Teemu R. 2024-11-11 10:31:13 +01:00 committed by GitHub
parent 66eb17057e
commit e5dd874333
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 8 deletions

View File

@ -44,6 +44,10 @@
], ],
"err_code": 0, "err_code": 0,
"ver": "1.0" "ver": "1.0"
},
"get_current_brt": {
"err_code": 0,
"value": 16
} }
}, },
"smartlife.iot.PIR": { "smartlife.iot.PIR": {
@ -55,11 +59,11 @@
0 0
], ],
"cold_time": 120000, "cold_time": 120000,
"enable": 0, "enable": 1,
"err_code": 0, "err_code": 0,
"max_adc": 4095, "max_adc": 4095,
"min_adc": 0, "min_adc": 0,
"trigger_index": 1, "trigger_index": 0,
"version": "1.0" "version": "1.0"
} }
}, },
@ -71,7 +75,7 @@
"fadeOnTime": 0, "fadeOnTime": 0,
"gentleOffTime": 10000, "gentleOffTime": 10000,
"gentleOnTime": 3000, "gentleOnTime": 3000,
"minThreshold": 5, "minThreshold": 17,
"rampRate": 30 "rampRate": 30
} }
}, },
@ -88,9 +92,9 @@
"hw_ver": "1.0", "hw_ver": "1.0",
"icon_hash": "", "icon_hash": "",
"latitude_i": 0, "latitude_i": 0,
"led_off": 0, "led_off": 1,
"longitude_i": 0, "longitude_i": 0,
"mac": "28:87:BA:00:00:00", "mac": "B0:A7:B9:00:00:00",
"mic_type": "IOT.SMARTPLUGSWITCH", "mic_type": "IOT.SMARTPLUGSWITCH",
"model": "ES20M(US)", "model": "ES20M(US)",
"next_action": { "next_action": {
@ -98,7 +102,7 @@
}, },
"obd_src": "tplink", "obd_src": "tplink",
"oemId": "00000000000000000000000000000000", "oemId": "00000000000000000000000000000000",
"on_time": 0, "on_time": 6,
"preferred_state": [ "preferred_state": [
{ {
"brightness": 100, "brightness": 100,
@ -117,8 +121,8 @@
"index": 3 "index": 3
} }
], ],
"relay_state": 0, "relay_state": 1,
"rssi": -54, "rssi": -40,
"status": "new", "status": "new",
"sw_ver": "1.0.11 Build 240514 Rel.110351", "sw_ver": "1.0.11 Build 240514 Rel.110351",
"updating": 0 "updating": 0

View File

@ -9,6 +9,7 @@ from .conftest import dimmer_iot, handle_turn_on, turn_on
@dimmer_iot @dimmer_iot
async def test_set_brightness(dev): async def test_set_brightness(dev):
await handle_turn_on(dev, False) await handle_turn_on(dev, False)
await dev.update()
assert dev.is_on is False assert dev.is_on is False
await dev.set_brightness(99) await dev.set_brightness(99)
@ -89,6 +90,7 @@ async def test_turn_off_transition(dev, mocker):
original_brightness = dev.brightness original_brightness = dev.brightness
await dev.turn_off(transition=1000) await dev.turn_off(transition=1000)
await dev.update()
assert dev.is_off assert dev.is_off
assert dev.brightness == original_brightness 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") query_helper = mocker.spy(IotDimmer, "_query_helper")
await dev.set_dimmer_transition(0, 1000) await dev.set_dimmer_transition(0, 1000)
await dev.update()
assert dev.is_off assert dev.is_off
assert dev.brightness == original_brightness assert dev.brightness == original_brightness