dump_devinfo improvements (#657)

* dump_devinfo improvements

* Scrub only the last three bytes for mac addresses
* Add --target to allow creating fixtures based on discovery
* Save fixtures directly to correct location, add --basedir to allow defining the location of repository root
* Add --autosave to disable prompting for saving

* Update fixtures for devices I have

* Add fixture for HS110 hw 4.0 fw 1.0.4

* Improve help strings

* Fix tests

* Update devtools README

* Default to discovery if no host/target given
This commit is contained in:
Teemu R
2024-01-20 14:20:08 +01:00
committed by GitHub
parent 49cfef087c
commit f77e87dc5d
11 changed files with 307 additions and 165 deletions

View File

@@ -106,7 +106,7 @@
"factory_default": false,
"ip": "127.0.0.123",
"is_support_iot_cloud": true,
"mac": "00-00-00-00-00-00",
"mac": "5C-E9-31-00-00-00",
"mgt_encrypt_schm": {
"encrypt_type": "AES",
"http_port": 80,
@@ -141,7 +141,7 @@
"get_device_info": {
"avatar": "bulb",
"brightness": 100,
"color_temp": 2500,
"color_temp": 6500,
"color_temp_range": [
2500,
6500
@@ -150,33 +150,33 @@
"re_power_type": "always_on",
"state": {
"brightness": 100,
"color_temp": 2500,
"hue": 31,
"saturation": 88
"color_temp": 6500,
"hue": 9,
"saturation": 67
},
"type": "last_states"
},
"device_id": "0000000000000000000000000000000000000000",
"device_on": false,
"device_on": true,
"dynamic_light_effect_enable": false,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.6 Build 230509 Rel.195312",
"has_set_location_info": true,
"hue": 31,
"hue": 9,
"hw_id": "00000000000000000000000000000000",
"hw_ver": "3.0",
"ip": "127.0.0.123",
"lang": "en_US",
"latitude": 0,
"longitude": 0,
"mac": "00-00-00-00-00-00",
"mac": "5C-E9-31-00-00-00",
"model": "L530",
"nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000",
"overheated": false,
"region": "Europe/Berlin",
"rssi": -48,
"saturation": 88,
"saturation": 67,
"signal_level": 3,
"specs": "",
"ssid": "I01BU0tFRF9TU0lEIw==",
@@ -186,23 +186,23 @@
"get_device_time": {
"region": "Europe/Berlin",
"time_diff": 60,
"timestamp": 1704212283
"timestamp": 1705700000
},
"get_device_usage": {
"power_usage": {
"past30": 53,
"past7": 12,
"today": 0
"past30": 19,
"past7": 3,
"today": 3
},
"saved_power": {
"past30": 494,
"past7": 112,
"today": 0
"past30": 179,
"past7": 20,
"today": 20
},
"time_usage": {
"past30": 547,
"past7": 124,
"today": 0
"past30": 198,
"past7": 23,
"today": 23
}
},
"get_dynamic_light_effect_rules": {

View File

@@ -110,7 +110,7 @@
"factory_default": false,
"ip": "127.0.0.123",
"is_support_iot_cloud": true,
"mac": "00-00-00-00-00-00",
"mac": "A8-42-A1-00-00-00",
"mgt_encrypt_schm": {
"encrypt_type": "AES",
"http_port": 80,
@@ -141,7 +141,7 @@
"get_device_info": {
"avatar": "",
"brightness": 100,
"color_temp": 9000,
"color_temp": 0,
"color_temp_range": [
9000,
9000
@@ -149,18 +149,18 @@
"default_states": {
"state": {
"brightness": 100,
"color_temp": 9000,
"hue": 0,
"saturation": 100
"color_temp": 0,
"hue": 354,
"saturation": 93
},
"type": "last_states"
},
"device_id": "0000000000000000000000000000000000000000",
"device_on": true,
"device_on": false,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.17 Build 230426 Rel.153230",
"has_set_location_info": false,
"hue": 0,
"hue": 354,
"hw_id": "00000000000000000000000000000000",
"hw_ver": "1.0",
"ip": "127.0.0.123",
@@ -175,7 +175,7 @@
"name": "station"
},
"longitude": 0,
"mac": "00-00-00-00-00-00",
"mac": "A8-42-A1-00-00-00",
"model": "L900",
"music_rhythm_enable": false,
"music_rhythm_mode": "single_lamp",
@@ -183,8 +183,8 @@
"oem_id": "00000000000000000000000000000000",
"overheated": false,
"region": "Europe/Berlin",
"rssi": -50,
"saturation": 100,
"rssi": -55,
"saturation": 93,
"signal_level": 2,
"specs": "",
"ssid": "I01BU0tFRF9TU0lEIw==",
@@ -194,23 +194,23 @@
"get_device_time": {
"region": "Europe/Berlin",
"time_diff": 0,
"timestamp": 1704389578
"timestamp": 1705699997
},
"get_device_usage": {
"power_usage": {
"past30": 5,
"past7": 5,
"today": 5
"past30": 15,
"past7": 0,
"today": 0
},
"saved_power": {
"past30": 17,
"past7": 17,
"today": 17
"past30": 81,
"past7": 1,
"today": 0
},
"time_usage": {
"past30": 22,
"past7": 22,
"today": 22
"past30": 96,
"past7": 1,
"today": 0
}
},
"get_fw_download_state": {
@@ -221,6 +221,84 @@
"upgrade_time": 5
},
"get_inherit_info": null,
"get_lighting_effect": {
"brightness": 50,
"custom": 0,
"direction": 1,
"display_colors": [],
"duration": 0,
"enable": 0,
"expansion_strategy": 2,
"id": "",
"name": "station",
"repeat_times": 1,
"segment_length": 1,
"sequence": [
[
300,
100,
50
],
[
240,
100,
50
],
[
180,
100,
50
],
[
120,
100,
50
],
[
60,
100,
50
],
[
0,
100,
50
],
[
0,
0,
50
],
[
0,
0,
50
],
[
0,
0,
50
],
[
0,
0,
50
],
[
0,
0,
50
],
[
0,
0,
50
]
],
"spread": 16,
"transition": 400,
"type": "sequence"
},
"get_next_event": {},
"get_on_off_gradually_info": {
"enable": false

View File

@@ -86,7 +86,7 @@
"factory_default": false,
"ip": "127.0.0.123",
"is_support_iot_cloud": true,
"mac": "00-00-00-00-00-00",
"mac": "48-22-54-00-00-00",
"mgt_encrypt_schm": {
"encrypt_type": "AES",
"http_port": 80,
@@ -140,7 +140,7 @@
"lang": "en_US",
"latitude": 0,
"longitude": 0,
"mac": "00-00-00-00-00-00",
"mac": "48-22-54-00-00-00",
"model": "P110",
"nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000",
@@ -158,23 +158,23 @@
"get_device_time": {
"region": "Europe/Berlin",
"time_diff": 60,
"timestamp": 1704212614
"timestamp": 1705699998
},
"get_device_usage": {
"power_usage": {
"past30": 896,
"past7": 259,
"today": 0
"past30": 1010,
"past7": 368,
"today": 46
},
"saved_power": {
"past30": 23138,
"past7": 6684,
"today": 0
"past30": 26144,
"past7": 9536,
"today": 1218
},
"time_usage": {
"past30": 24034,
"past7": 6943,
"today": 0
"past30": 27154,
"past7": 9904,
"today": 1264
}
},
"get_electricity_price_config": {
@@ -316,11 +316,11 @@
0,
0
],
"local_time": "2024-01-02 17:23:34",
"month_energy": 0,
"month_runtime": 0,
"today_energy": 0,
"today_runtime": 0
"local_time": "2024-01-19 22:33:18",
"month_energy": 430,
"month_runtime": 11571,
"today_energy": 46,
"today_runtime": 1264
},
"get_fw_download_state": {
"auto_upgrade": false,
@@ -341,7 +341,7 @@
}
},
"get_max_power": {
"max_power": 3847
"max_power": 3904
},
"get_next_event": {},
"get_protection_power": {
@@ -356,7 +356,16 @@
"sum": 0
},
"get_wireless_scan_info": {
"ap_list": [],
"ap_list": [
{
"bssid": "000000000000",
"channel": 0,
"cipher_type": 2,
"key_type": "wpa_psk",
"signal_level": 3,
"ssid": "I01BU0tFRF9TU0lEIw=="
}
],
"wep_supported": false
},
"qs_component_nego": {