From 6ba7c4ac057f73722239bbb9719a5bcf747ea11a Mon Sep 17 00:00:00 2001 From: "Teemu R." Date: Fri, 18 Oct 2024 14:00:23 +0200 Subject: [PATCH] Convert fixtures to use unix newlines (#1177) Also, add a .gitattributes entry to let git handle this automatically for json files --- .gitattributes | 1 + kasa/tests/fixtures/KL135(US)_1.0_1.0.15.json | 186 +-- .../fixtures/smart/S505D(US)_1.0_1.1.0.json | 524 ++++---- .../smart/child/T100(EU)_1.0_1.12.0.json | 1074 ++++++++--------- .../smart/child/T110(EU)_1.0_1.8.0.json | 1052 ++++++++-------- 5 files changed, 1419 insertions(+), 1418 deletions(-) diff --git a/.gitattributes b/.gitattributes index f1815500..01a1c581 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,2 @@ *.sh text eol=lf +*.json text eol=lf diff --git a/kasa/tests/fixtures/KL135(US)_1.0_1.0.15.json b/kasa/tests/fixtures/KL135(US)_1.0_1.0.15.json index a9e83194..8d8aa1fe 100644 --- a/kasa/tests/fixtures/KL135(US)_1.0_1.0.15.json +++ b/kasa/tests/fixtures/KL135(US)_1.0_1.0.15.json @@ -1,93 +1,93 @@ -{ - "smartlife.iot.common.emeter": { - "get_realtime": { - "err_code": 0, - "power_mw": 0, - "total_wh": 25 - } - }, - "smartlife.iot.smartbulb.lightingservice": { - "get_light_state": { - "dft_on_state": { - "brightness": 98, - "color_temp": 6500, - "hue": 28, - "mode": "normal", - "saturation": 72 - }, - "err_code": 0, - "on_off": 0 - } - }, - "system": { - "get_sysinfo": { - "active_mode": "none", - "alias": "#MASKED_NAME#", - "ctrl_protocols": { - "name": "Linkie", - "version": "1.0" - }, - "description": "Smart Wi-Fi LED Bulb with Color Changing", - "dev_state": "normal", - "deviceId": "0000000000000000000000000000000000000000", - "disco_ver": "1.0", - "err_code": 0, - "hwId": "00000000000000000000000000000000", - "hw_ver": "1.0", - "is_color": 1, - "is_dimmable": 1, - "is_factory": false, - "is_variable_color_temp": 1, - "latitude_i": 0, - "light_state": { - "dft_on_state": { - "brightness": 98, - "color_temp": 6500, - "hue": 28, - "mode": "normal", - "saturation": 72 - }, - "on_off": 0 - }, - "longitude_i": 0, - "mic_mac": "000000000000", - "mic_type": "IOT.SMARTBULB", - "model": "KL135(US)", - "obd_src": "tplink", - "oemId": "00000000000000000000000000000000", - "preferred_state": [ - { - "brightness": 50, - "color_temp": 2700, - "hue": 0, - "index": 0, - "saturation": 0 - }, - { - "brightness": 100, - "color_temp": 0, - "hue": 0, - "index": 1, - "saturation": 100 - }, - { - "brightness": 100, - "color_temp": 0, - "hue": 120, - "index": 2, - "saturation": 100 - }, - { - "brightness": 100, - "color_temp": 0, - "hue": 240, - "index": 3, - "saturation": 100 - } - ], - "rssi": -41, - "status": "new", - "sw_ver": "1.0.15 Build 240429 Rel.154143" - } - } -} +{ + "smartlife.iot.common.emeter": { + "get_realtime": { + "err_code": 0, + "power_mw": 0, + "total_wh": 25 + } + }, + "smartlife.iot.smartbulb.lightingservice": { + "get_light_state": { + "dft_on_state": { + "brightness": 98, + "color_temp": 6500, + "hue": 28, + "mode": "normal", + "saturation": 72 + }, + "err_code": 0, + "on_off": 0 + } + }, + "system": { + "get_sysinfo": { + "active_mode": "none", + "alias": "#MASKED_NAME#", + "ctrl_protocols": { + "name": "Linkie", + "version": "1.0" + }, + "description": "Smart Wi-Fi LED Bulb with Color Changing", + "dev_state": "normal", + "deviceId": "0000000000000000000000000000000000000000", + "disco_ver": "1.0", + "err_code": 0, + "hwId": "00000000000000000000000000000000", + "hw_ver": "1.0", + "is_color": 1, + "is_dimmable": 1, + "is_factory": false, + "is_variable_color_temp": 1, + "latitude_i": 0, + "light_state": { + "dft_on_state": { + "brightness": 98, + "color_temp": 6500, + "hue": 28, + "mode": "normal", + "saturation": 72 + }, + "on_off": 0 + }, + "longitude_i": 0, + "mic_mac": "000000000000", + "mic_type": "IOT.SMARTBULB", + "model": "KL135(US)", + "obd_src": "tplink", + "oemId": "00000000000000000000000000000000", + "preferred_state": [ + { + "brightness": 50, + "color_temp": 2700, + "hue": 0, + "index": 0, + "saturation": 0 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 0, + "index": 1, + "saturation": 100 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 120, + "index": 2, + "saturation": 100 + }, + { + "brightness": 100, + "color_temp": 0, + "hue": 240, + "index": 3, + "saturation": 100 + } + ], + "rssi": -41, + "status": "new", + "sw_ver": "1.0.15 Build 240429 Rel.154143" + } + } +} diff --git a/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json b/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json index 97486d45..6adac986 100644 --- a/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json +++ b/kasa/tests/fixtures/smart/S505D(US)_1.0_1.1.0.json @@ -1,262 +1,262 @@ -{ - "component_nego": { - "component_list": [ - { - "id": "device", - "ver_code": 2 - }, - { - "id": "firmware", - "ver_code": 2 - }, - { - "id": "quick_setup", - "ver_code": 3 - }, - { - "id": "inherit", - "ver_code": 1 - }, - { - "id": "time", - "ver_code": 1 - }, - { - "id": "wireless", - "ver_code": 1 - }, - { - "id": "schedule", - "ver_code": 2 - }, - { - "id": "countdown", - "ver_code": 2 - }, - { - "id": "antitheft", - "ver_code": 1 - }, - { - "id": "account", - "ver_code": 1 - }, - { - "id": "synchronize", - "ver_code": 1 - }, - { - "id": "sunrise_sunset", - "ver_code": 1 - }, - { - "id": "led", - "ver_code": 1 - }, - { - "id": "cloud_connect", - "ver_code": 1 - }, - { - "id": "iot_cloud", - "ver_code": 1 - }, - { - "id": "device_local_time", - "ver_code": 1 - }, - { - "id": "default_states", - "ver_code": 1 - }, - { - "id": "brightness", - "ver_code": 1 - }, - { - "id": "preset", - "ver_code": 1 - }, - { - "id": "on_off_gradually", - "ver_code": 2 - }, - { - "id": "dimmer_calibration", - "ver_code": 1 - }, - { - "id": "localSmart", - "ver_code": 1 - }, - { - "id": "overheat_protection", - "ver_code": 1 - }, - { - "id": "matter", - "ver_code": 2 - } - ] - }, - "discovery_result": { - "device_id": "00000000000000000000000000000000", - "device_model": "S505D(US)", - "device_type": "SMART.TAPOSWITCH", - "factory_default": false, - "ip": "127.0.0.123", - "is_support_iot_cloud": true, - "mac": "48-22-54-00-00-00", - "mgt_encrypt_schm": { - "encrypt_type": "KLAP", - "http_port": 80, - "is_support_https": false, - "lv": 2 - }, - "obd_src": "matter", - "owner": "00000000000000000000000000000000" - }, - "get_antitheft_rules": { - "antitheft_rule_max_count": 1, - "enable": false, - "rule_list": [] - }, - "get_auto_update_info": { - "enable": true, - "random_range": 120, - "time": 180 - }, - "get_connect_cloud_state": { - "status": 1 - }, - "get_countdown_rules": { - "countdown_rule_max_count": 1, - "enable": false, - "rule_list": [] - }, - "get_device_info": { - "avatar": "switch_s500d", - "brightness": 100, - "default_states": { - "re_power_type": "always_off", - "re_power_type_capability": [ - "last_states", - "always_on", - "always_off" - ], - "type": "last_states" - }, - "device_id": "0000000000000000000000000000000000000000", - "device_on": false, - "fw_id": "00000000000000000000000000000000", - "fw_ver": "1.1.0 Build 231024 Rel.201030", - "has_set_location_info": false, - "hw_id": "00000000000000000000000000000000", - "hw_ver": "1.0", - "ip": "127.0.0.123", - "lang": "en_US", - "latitude": 0, - "longitude": 0, - "mac": "48-22-54-00-00-00", - "model": "S505D", - "nickname": "I01BU0tFRF9OQU1FIw==", - "oem_id": "00000000000000000000000000000000", - "on_time": 0, - "overheat_status": "normal", - "region": "America/Chicago", - "rssi": -39, - "signal_level": 3, - "specs": "", - "ssid": "I01BU0tFRF9TU0lEIw==", - "time_diff": -360, - "type": "SMART.TAPOSWITCH" - }, - "get_device_time": { - "region": "America/Chicago", - "time_diff": -360, - "timestamp": 952082825 - }, - "get_fw_download_state": { - "auto_upgrade": false, - "download_progress": 0, - "reboot_time": 5, - "status": 0, - "upgrade_time": 5 - }, - "get_inherit_info": null, - "get_led_info": { - "led_rule": "always", - "led_status": true, - "night_mode": { - "end_time": 420, - "night_mode_type": "sunrise_sunset", - "start_time": 1140, - "sunrise_offset": 0, - "sunset_offset": 0 - } - }, - "get_matter_setup_info": { - "setup_code": "00000000000", - "setup_payload": "00:-00000000000000.000" - }, - "get_next_event": {}, - "get_preset_rules": { - "brightness": [ - 100, - 75, - 50, - 25, - 1 - ] - }, - "get_schedule_rules": { - "enable": false, - "rule_list": [], - "schedule_rule_max_count": 32, - "start_index": 0, - "sum": 0 - }, - "get_wireless_scan_info": { - "ap_list": [], - "start_index": 0, - "sum": 0, - "wep_supported": false - }, - "qs_component_nego": { - "component_list": [ - { - "id": "quick_setup", - "ver_code": 3 - }, - { - "id": "sunrise_sunset", - "ver_code": 1 - }, - { - "id": "ble_whole_setup", - "ver_code": 1 - }, - { - "id": "matter", - "ver_code": 2 - }, - { - "id": "iot_cloud", - "ver_code": 1 - }, - { - "id": "inherit", - "ver_code": 1 - }, - { - "id": "firmware", - "ver_code": 2 - } - ], - "extra_info": { - "device_model": "S505D", - "device_type": "SMART.TAPOSWITCH", - "is_klap": true - } - } -} +{ + "component_nego": { + "component_list": [ + { + "id": "device", + "ver_code": 2 + }, + { + "id": "firmware", + "ver_code": 2 + }, + { + "id": "quick_setup", + "ver_code": 3 + }, + { + "id": "inherit", + "ver_code": 1 + }, + { + "id": "time", + "ver_code": 1 + }, + { + "id": "wireless", + "ver_code": 1 + }, + { + "id": "schedule", + "ver_code": 2 + }, + { + "id": "countdown", + "ver_code": 2 + }, + { + "id": "antitheft", + "ver_code": 1 + }, + { + "id": "account", + "ver_code": 1 + }, + { + "id": "synchronize", + "ver_code": 1 + }, + { + "id": "sunrise_sunset", + "ver_code": 1 + }, + { + "id": "led", + "ver_code": 1 + }, + { + "id": "cloud_connect", + "ver_code": 1 + }, + { + "id": "iot_cloud", + "ver_code": 1 + }, + { + "id": "device_local_time", + "ver_code": 1 + }, + { + "id": "default_states", + "ver_code": 1 + }, + { + "id": "brightness", + "ver_code": 1 + }, + { + "id": "preset", + "ver_code": 1 + }, + { + "id": "on_off_gradually", + "ver_code": 2 + }, + { + "id": "dimmer_calibration", + "ver_code": 1 + }, + { + "id": "localSmart", + "ver_code": 1 + }, + { + "id": "overheat_protection", + "ver_code": 1 + }, + { + "id": "matter", + "ver_code": 2 + } + ] + }, + "discovery_result": { + "device_id": "00000000000000000000000000000000", + "device_model": "S505D(US)", + "device_type": "SMART.TAPOSWITCH", + "factory_default": false, + "ip": "127.0.0.123", + "is_support_iot_cloud": true, + "mac": "48-22-54-00-00-00", + "mgt_encrypt_schm": { + "encrypt_type": "KLAP", + "http_port": 80, + "is_support_https": false, + "lv": 2 + }, + "obd_src": "matter", + "owner": "00000000000000000000000000000000" + }, + "get_antitheft_rules": { + "antitheft_rule_max_count": 1, + "enable": false, + "rule_list": [] + }, + "get_auto_update_info": { + "enable": true, + "random_range": 120, + "time": 180 + }, + "get_connect_cloud_state": { + "status": 1 + }, + "get_countdown_rules": { + "countdown_rule_max_count": 1, + "enable": false, + "rule_list": [] + }, + "get_device_info": { + "avatar": "switch_s500d", + "brightness": 100, + "default_states": { + "re_power_type": "always_off", + "re_power_type_capability": [ + "last_states", + "always_on", + "always_off" + ], + "type": "last_states" + }, + "device_id": "0000000000000000000000000000000000000000", + "device_on": false, + "fw_id": "00000000000000000000000000000000", + "fw_ver": "1.1.0 Build 231024 Rel.201030", + "has_set_location_info": false, + "hw_id": "00000000000000000000000000000000", + "hw_ver": "1.0", + "ip": "127.0.0.123", + "lang": "en_US", + "latitude": 0, + "longitude": 0, + "mac": "48-22-54-00-00-00", + "model": "S505D", + "nickname": "I01BU0tFRF9OQU1FIw==", + "oem_id": "00000000000000000000000000000000", + "on_time": 0, + "overheat_status": "normal", + "region": "America/Chicago", + "rssi": -39, + "signal_level": 3, + "specs": "", + "ssid": "I01BU0tFRF9TU0lEIw==", + "time_diff": -360, + "type": "SMART.TAPOSWITCH" + }, + "get_device_time": { + "region": "America/Chicago", + "time_diff": -360, + "timestamp": 952082825 + }, + "get_fw_download_state": { + "auto_upgrade": false, + "download_progress": 0, + "reboot_time": 5, + "status": 0, + "upgrade_time": 5 + }, + "get_inherit_info": null, + "get_led_info": { + "led_rule": "always", + "led_status": true, + "night_mode": { + "end_time": 420, + "night_mode_type": "sunrise_sunset", + "start_time": 1140, + "sunrise_offset": 0, + "sunset_offset": 0 + } + }, + "get_matter_setup_info": { + "setup_code": "00000000000", + "setup_payload": "00:-00000000000000.000" + }, + "get_next_event": {}, + "get_preset_rules": { + "brightness": [ + 100, + 75, + 50, + 25, + 1 + ] + }, + "get_schedule_rules": { + "enable": false, + "rule_list": [], + "schedule_rule_max_count": 32, + "start_index": 0, + "sum": 0 + }, + "get_wireless_scan_info": { + "ap_list": [], + "start_index": 0, + "sum": 0, + "wep_supported": false + }, + "qs_component_nego": { + "component_list": [ + { + "id": "quick_setup", + "ver_code": 3 + }, + { + "id": "sunrise_sunset", + "ver_code": 1 + }, + { + "id": "ble_whole_setup", + "ver_code": 1 + }, + { + "id": "matter", + "ver_code": 2 + }, + { + "id": "iot_cloud", + "ver_code": 1 + }, + { + "id": "inherit", + "ver_code": 1 + }, + { + "id": "firmware", + "ver_code": 2 + } + ], + "extra_info": { + "device_model": "S505D", + "device_type": "SMART.TAPOSWITCH", + "is_klap": true + } + } +} diff --git a/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json b/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json index 00e46787..0103fbdc 100644 --- a/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json +++ b/kasa/tests/fixtures/smart/child/T100(EU)_1.0_1.12.0.json @@ -1,537 +1,537 @@ -{ - "component_nego": { - "component_list": [ - { - "id": "device", - "ver_code": 2 - }, - { - "id": "quick_setup", - "ver_code": 3 - }, - { - "id": "trigger_log", - "ver_code": 1 - }, - { - "id": "time", - "ver_code": 1 - }, - { - "id": "device_local_time", - "ver_code": 1 - }, - { - "id": "account", - "ver_code": 1 - }, - { - "id": "synchronize", - "ver_code": 1 - }, - { - "id": "cloud_connect", - "ver_code": 1 - }, - { - "id": "iot_cloud", - "ver_code": 1 - }, - { - "id": "firmware", - "ver_code": 1 - }, - { - "id": "localSmart", - "ver_code": 1 - }, - { - "id": "battery_detect", - "ver_code": 1 - }, - { - "id": "sensitivity", - "ver_code": 1 - } - ] - }, - "get_connect_cloud_state": { - "status": 0 - }, - "get_device_info": { - "at_low_battery": false, - "avatar": "sensor", - "bind_count": 1, - "category": "subg.trigger.motion-sensor", - "detected": false, - "device_id": "SCRUBBED_CHILD_DEVICE_ID_3", - "fw_ver": "1.12.0 Build 230512 Rel.103011", - "hw_id": "00000000000000000000000000000000", - "hw_ver": "1.0", - "jamming_rssi": -118, - "jamming_signal_level": 1, - "lastOnboardingTimestamp": 1703860126, - "mac": "E4FAC4000000", - "model": "T100", - "nickname": "I01BU0tFRF9OQU1FIw==", - "oem_id": "00000000000000000000000000000000", - "parent_device_id": "0000000000000000000000000000000000000000", - "region": "Europe/Berlin", - "report_interval": 60, - "rssi": -73, - "signal_level": 2, - "specs": "EU", - "status": "online", - "status_follow_edge": false, - "type": "SMART.TAPOSENSOR" - }, - "get_fw_download_state": { - "cloud_cache_seconds": 1, - "download_progress": 0, - "reboot_time": 5, - "status": 0, - "upgrade_time": 5 - }, - "get_latest_fw": { - "fw_size": 0, - "fw_ver": "1.12.0 Build 230512 Rel.103011", - "hw_id": "", - "need_to_upgrade": false, - "oem_id": "", - "release_date": "", - "release_note": "", - "type": 0 - }, - "get_temp_humidity_records": { - "local_time": 1721645923, - "past24h_humidity": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_humidity_exception": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_temp": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_temp_exception": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "temp_unit": "celsius" - }, - "get_trigger_logs": { - "logs": [ - { - "event": "motion", - "eventId": "f883b62c-e18f-30ef-883b-62ce18f30ef8", - "id": 28763, - "timestamp": 1721643865 - }, - { - "event": "motion", - "eventId": "c5157545-55d5-157d-4157-54555d5157d4", - "id": 28748, - "timestamp": 1721630821 - }, - { - "event": "motion", - "eventId": "1b587961-edab-08d1-b587-961edab08d1b", - "id": 28746, - "timestamp": 1721629441 - }, - { - "event": "motion", - "eventId": "8ac5e271-3894-c269-bc5e-2713894c269b", - "id": 28738, - "timestamp": 1721622777 - }, - { - "event": "motion", - "eventId": "1ef8037e-c097-bc21-ef80-37ec097bc21e", - "id": 28722, - "timestamp": 1721596432 - } - ], - "start_id": 28763, - "sum": 86 - } -} +{ + "component_nego": { + "component_list": [ + { + "id": "device", + "ver_code": 2 + }, + { + "id": "quick_setup", + "ver_code": 3 + }, + { + "id": "trigger_log", + "ver_code": 1 + }, + { + "id": "time", + "ver_code": 1 + }, + { + "id": "device_local_time", + "ver_code": 1 + }, + { + "id": "account", + "ver_code": 1 + }, + { + "id": "synchronize", + "ver_code": 1 + }, + { + "id": "cloud_connect", + "ver_code": 1 + }, + { + "id": "iot_cloud", + "ver_code": 1 + }, + { + "id": "firmware", + "ver_code": 1 + }, + { + "id": "localSmart", + "ver_code": 1 + }, + { + "id": "battery_detect", + "ver_code": 1 + }, + { + "id": "sensitivity", + "ver_code": 1 + } + ] + }, + "get_connect_cloud_state": { + "status": 0 + }, + "get_device_info": { + "at_low_battery": false, + "avatar": "sensor", + "bind_count": 1, + "category": "subg.trigger.motion-sensor", + "detected": false, + "device_id": "SCRUBBED_CHILD_DEVICE_ID_3", + "fw_ver": "1.12.0 Build 230512 Rel.103011", + "hw_id": "00000000000000000000000000000000", + "hw_ver": "1.0", + "jamming_rssi": -118, + "jamming_signal_level": 1, + "lastOnboardingTimestamp": 1703860126, + "mac": "E4FAC4000000", + "model": "T100", + "nickname": "I01BU0tFRF9OQU1FIw==", + "oem_id": "00000000000000000000000000000000", + "parent_device_id": "0000000000000000000000000000000000000000", + "region": "Europe/Berlin", + "report_interval": 60, + "rssi": -73, + "signal_level": 2, + "specs": "EU", + "status": "online", + "status_follow_edge": false, + "type": "SMART.TAPOSENSOR" + }, + "get_fw_download_state": { + "cloud_cache_seconds": 1, + "download_progress": 0, + "reboot_time": 5, + "status": 0, + "upgrade_time": 5 + }, + "get_latest_fw": { + "fw_size": 0, + "fw_ver": "1.12.0 Build 230512 Rel.103011", + "hw_id": "", + "need_to_upgrade": false, + "oem_id": "", + "release_date": "", + "release_note": "", + "type": 0 + }, + "get_temp_humidity_records": { + "local_time": 1721645923, + "past24h_humidity": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_humidity_exception": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_temp": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_temp_exception": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "temp_unit": "celsius" + }, + "get_trigger_logs": { + "logs": [ + { + "event": "motion", + "eventId": "f883b62c-e18f-30ef-883b-62ce18f30ef8", + "id": 28763, + "timestamp": 1721643865 + }, + { + "event": "motion", + "eventId": "c5157545-55d5-157d-4157-54555d5157d4", + "id": 28748, + "timestamp": 1721630821 + }, + { + "event": "motion", + "eventId": "1b587961-edab-08d1-b587-961edab08d1b", + "id": 28746, + "timestamp": 1721629441 + }, + { + "event": "motion", + "eventId": "8ac5e271-3894-c269-bc5e-2713894c269b", + "id": 28738, + "timestamp": 1721622777 + }, + { + "event": "motion", + "eventId": "1ef8037e-c097-bc21-ef80-37ec097bc21e", + "id": 28722, + "timestamp": 1721596432 + } + ], + "start_id": 28763, + "sum": 86 + } +} diff --git a/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json b/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json index acf7ae88..0393e18b 100644 --- a/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json +++ b/kasa/tests/fixtures/smart/child/T110(EU)_1.0_1.8.0.json @@ -1,526 +1,526 @@ -{ - "component_nego": { - "component_list": [ - { - "id": "device", - "ver_code": 2 - }, - { - "id": "quick_setup", - "ver_code": 3 - }, - { - "id": "trigger_log", - "ver_code": 1 - }, - { - "id": "time", - "ver_code": 1 - }, - { - "id": "device_local_time", - "ver_code": 1 - }, - { - "id": "account", - "ver_code": 1 - }, - { - "id": "synchronize", - "ver_code": 1 - }, - { - "id": "cloud_connect", - "ver_code": 1 - }, - { - "id": "iot_cloud", - "ver_code": 1 - }, - { - "id": "firmware", - "ver_code": 1 - }, - { - "id": "localSmart", - "ver_code": 1 - }, - { - "id": "battery_detect", - "ver_code": 1 - } - ] - }, - "get_connect_cloud_state": { - "status": 0 - }, - "get_device_info": { - "at_low_battery": false, - "avatar": "sensor_t110", - "bind_count": 1, - "category": "subg.trigger.contact-sensor", - "device_id": "SCRUBBED_CHILD_DEVICE_ID_2", - "fw_ver": "1.8.0 Build 220728 Rel.160024", - "hw_id": "00000000000000000000000000000000", - "hw_ver": "1.0", - "jamming_rssi": -113, - "jamming_signal_level": 1, - "lastOnboardingTimestamp": 1714661626, - "mac": "E4FAC4000000", - "model": "T110", - "nickname": "I01BU0tFRF9OQU1FIw==", - "oem_id": "00000000000000000000000000000000", - "open": false, - "parent_device_id": "0000000000000000000000000000000000000000", - "region": "Europe/Berlin", - "report_interval": 16, - "rssi": -54, - "signal_level": 3, - "specs": "EU", - "status": "online", - "status_follow_edge": false, - "type": "SMART.TAPOSENSOR" - }, - "get_fw_download_state": { - "cloud_cache_seconds": 1, - "download_progress": 30, - "reboot_time": 5, - "status": 4, - "upgrade_time": 5 - }, - "get_latest_fw": { - "fw_ver": "1.9.0 Build 230704 Rel.154531", - "hw_id": "00000000000000000000000000000000", - "need_to_upgrade": true, - "oem_id": "00000000000000000000000000000000", - "release_date": "2023-10-30", - "release_note": "Modifications and Bug Fixes:\n1. Reduced power consumption.\n2. Fixed some minor bugs.", - "type": 2 - }, - "get_temp_humidity_records": { - "local_time": 1714681046, - "past24h_humidity": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_humidity_exception": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_temp": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "past24h_temp_exception": [ - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000, - -1000 - ], - "temp_unit": "celsius" - }, - "get_trigger_logs": { - "logs": [ - { - "event": "close", - "eventId": "8140289c-c66b-bdd6-63b9-542299442299", - "id": 4, - "timestamp": 1714661714 - }, - { - "event": "open", - "eventId": "fb4e1439-2f2c-a5e1-c35a-9e7c0d35a1e3", - "id": 3, - "timestamp": 1714661710 - }, - { - "event": "close", - "eventId": "ddee7733-1180-48ac-56a3-512018048ac5", - "id": 2, - "timestamp": 1714661657 - }, - { - "event": "open", - "eventId": "ab80951f-da38-49f9-21c5-bf025c7b606d", - "id": 1, - "timestamp": 1714661638 - } - ], - "start_id": 4, - "sum": 4 - } -} +{ + "component_nego": { + "component_list": [ + { + "id": "device", + "ver_code": 2 + }, + { + "id": "quick_setup", + "ver_code": 3 + }, + { + "id": "trigger_log", + "ver_code": 1 + }, + { + "id": "time", + "ver_code": 1 + }, + { + "id": "device_local_time", + "ver_code": 1 + }, + { + "id": "account", + "ver_code": 1 + }, + { + "id": "synchronize", + "ver_code": 1 + }, + { + "id": "cloud_connect", + "ver_code": 1 + }, + { + "id": "iot_cloud", + "ver_code": 1 + }, + { + "id": "firmware", + "ver_code": 1 + }, + { + "id": "localSmart", + "ver_code": 1 + }, + { + "id": "battery_detect", + "ver_code": 1 + } + ] + }, + "get_connect_cloud_state": { + "status": 0 + }, + "get_device_info": { + "at_low_battery": false, + "avatar": "sensor_t110", + "bind_count": 1, + "category": "subg.trigger.contact-sensor", + "device_id": "SCRUBBED_CHILD_DEVICE_ID_2", + "fw_ver": "1.8.0 Build 220728 Rel.160024", + "hw_id": "00000000000000000000000000000000", + "hw_ver": "1.0", + "jamming_rssi": -113, + "jamming_signal_level": 1, + "lastOnboardingTimestamp": 1714661626, + "mac": "E4FAC4000000", + "model": "T110", + "nickname": "I01BU0tFRF9OQU1FIw==", + "oem_id": "00000000000000000000000000000000", + "open": false, + "parent_device_id": "0000000000000000000000000000000000000000", + "region": "Europe/Berlin", + "report_interval": 16, + "rssi": -54, + "signal_level": 3, + "specs": "EU", + "status": "online", + "status_follow_edge": false, + "type": "SMART.TAPOSENSOR" + }, + "get_fw_download_state": { + "cloud_cache_seconds": 1, + "download_progress": 30, + "reboot_time": 5, + "status": 4, + "upgrade_time": 5 + }, + "get_latest_fw": { + "fw_ver": "1.9.0 Build 230704 Rel.154531", + "hw_id": "00000000000000000000000000000000", + "need_to_upgrade": true, + "oem_id": "00000000000000000000000000000000", + "release_date": "2023-10-30", + "release_note": "Modifications and Bug Fixes:\n1. Reduced power consumption.\n2. Fixed some minor bugs.", + "type": 2 + }, + "get_temp_humidity_records": { + "local_time": 1714681046, + "past24h_humidity": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_humidity_exception": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_temp": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "past24h_temp_exception": [ + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000, + -1000 + ], + "temp_unit": "celsius" + }, + "get_trigger_logs": { + "logs": [ + { + "event": "close", + "eventId": "8140289c-c66b-bdd6-63b9-542299442299", + "id": 4, + "timestamp": 1714661714 + }, + { + "event": "open", + "eventId": "fb4e1439-2f2c-a5e1-c35a-9e7c0d35a1e3", + "id": 3, + "timestamp": 1714661710 + }, + { + "event": "close", + "eventId": "ddee7733-1180-48ac-56a3-512018048ac5", + "id": 2, + "timestamp": 1714661657 + }, + { + "event": "open", + "eventId": "ab80951f-da38-49f9-21c5-bf025c7b606d", + "id": 1, + "timestamp": 1714661638 + } + ], + "start_id": 4, + "sum": 4 + } +}