Closed tmstorey closed 6 months ago
Thanks for reporting this. I have added the L900 support without having one, so I'm not surprised I've missed a few things.
I suspect that adding a new LightStripHandler
and LightStripResult
pair would be the appropriate fix.
Can you please paste the output of get_device_info_json
?
Here's the output (with a few details redacted):
{
"avatar": "light_strip",
"brightness": 30,
"color_temp": 9000,
"color_temp_range": [9000, 9000],
"default_states": {
"state": {
"brightness": 30,
"color_temp": 9000,
"hue": 0,
"saturation": 100
}
,
"type": "last_states"
}
,
"device_id": "",
"device_on": true,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.1.0 Build 230905 Rel.184939",
"has_set_location_info": true,
"hue": 0,
"hw_id": "",
"hw_ver": "1.0",
"ip": "192.168.0.20",
"lang": "en_US",
"latitude": 0,
"lighting_effect": {
"brightness": 100,
"custom": 1,
"display_colors": [[359, 85, 100]],
"enable": 0,
"id": "b7a3f0e57258404dae904d77c9ffc6fa",
"name": "My Custom Sequence Effect"
}
,
"longitude": 0,
"mac": "24-2F-D0-18-8A-5E",
"model": "L900",
"music_rhythm_enable": false,
"music_rhythm_mode": "single_lamp",
"nickname": "",
"oem_id": "",
"overheated": false,
"region": "Australia/Sydney",
"rssi": -61,
"saturation": 100,
"signal_level": 2,
"specs": "",
"ssid": "",
"time_diff": 600,
"type": "SMART.TAPOBULB"
}
Reproduction:
Result:
Error: Serde(Error("missing field `dynamic_light_effect_enable`", line: 1, column: 1052))
get_device_info_json
is working correctly.The issue seems to be that
api_client.rs
is implementing L900 support using aColorLightHandler
rather than aColorLightStripHandler
. The L900 model is in fact a light strip and doesn't seem to return thedynamic_light_effect_enable
anddynamic_light_effect_id
fields in the JSON, which Serde expects.Changing this in the
ApiClient::l900
function builds in Rust and fixes the issue, but breaks the Python build as tapo-py doesn't support light strips.