Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions devtools/dump_devinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def scrub(res):
"alias",
"bssid",
"channel",
"original_device_id", # for child devices
]

for k, v in res.items():
Expand Down Expand Up @@ -96,6 +97,11 @@ def scrub(res):
v = "#MASKED_NAME#"
elif isinstance(res[k], int):
v = 0
elif k == "device_id" and len(v) > 40:
# retain the last two chars when scrubbing child ids
end = v[-2:]
v = re.sub(r"\w", "0", v)
v = v[:40] + end
else:
v = re.sub(r"\w", "0", v)

Expand Down
36 changes: 13 additions & 23 deletions kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.13.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"ver_code": 1
}
],
"device_id": "000000000000000000000000000000000000000000"
"device_id": "000000000000000000000000000000000000000002"
},
{
"component_list": [
Expand Down Expand Up @@ -235,7 +235,7 @@
"ver_code": 1
}
],
"device_id": "000000000000000000000000000000000000000000"
"device_id": "000000000000000000000000000000000000000001"
},
{
"component_list": [
Expand Down Expand Up @@ -318,7 +318,7 @@
},
"type": "custom"
},
"device_id": "000000000000000000000000000000000000000000",
"device_id": "000000000000000000000000000000000000000002",
"device_on": false,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.13 Build 230925 Rel.150200",
Expand All @@ -332,7 +332,7 @@
"nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000",
"on_time": 0,
"original_device_id": "8022852468EC205A8178C7CBE81FC119213BC020",
"original_device_id": "0000000000000000000000000000000000000000",
"overheat_status": "normal",
"position": 3,
"region": "Europe/Berlin",
Expand All @@ -347,7 +347,7 @@
"default_states": {
"type": "last_states"
},
"device_id": "000000000000000000000000000000000000000000",
"device_id": "000000000000000000000000000000000000000001",
"device_on": false,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.13 Build 230925 Rel.150200",
Expand All @@ -361,7 +361,7 @@
"nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000",
"on_time": 0,
"original_device_id": "8022852468EC205A8178C7CBE81FC119213BC020",
"original_device_id": "0000000000000000000000000000000000000000",
"overheat_status": "normal",
"position": 2,
"region": "Europe/Berlin",
Expand Down Expand Up @@ -393,7 +393,7 @@
"nickname": "I01BU0tFRF9OQU1FIw==",
"oem_id": "00000000000000000000000000000000",
"on_time": 0,
"original_device_id": "8022852468EC205A8178C7CBE81FC119213BC020",
"original_device_id": "0000000000000000000000000000000000000000",
"overheat_status": "normal",
"position": 1,
"region": "Europe/Berlin",
Expand All @@ -406,7 +406,7 @@
"sum": 3
},
"get_connect_cloud_state": {
"status": 0
"status": 2
},
"get_device_info": {
"avatar": "",
Expand Down Expand Up @@ -435,12 +435,12 @@
"get_device_time": {
"region": "Europe/Berlin",
"time_diff": 60,
"timestamp": 1706320181
"timestamp": 1706810351
},
"get_device_usage": {
"time_usage": {
"past30": 0,
"past7": 0,
"past30": 134,
"past7": 134,
"today": 0
}
},
Expand All @@ -451,23 +451,13 @@
"status": 0,
"upgrade_time": 5
},
"get_latest_fw": {
"fw_size": 0,
"fw_ver": "1.0.13 Build 230925 Rel.150200",
"hw_id": "",
"need_to_upgrade": false,
"oem_id": "",
"release_date": "",
"release_note": "",
"type": 0
},
"get_led_info": {
"led_rule": "night_mode",
"led_status": false,
"night_mode": {
"end_time": 496,
"end_time": 489,
"night_mode_type": "sunrise_sunset",
"start_time": 1034,
"start_time": 1043,
"sunrise_offset": 0,
"sunset_offset": 0
}
Expand Down
12 changes: 6 additions & 6 deletions kasa/tests/fixtures/smart/P300(EU)_1.0_1.0.7.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
"ver_code": 1
}
],
"device_id": "000000000000000000000000000000000000000000"
"device_id": "000000000000000000000000000000000000000001"
},
{
"component_list": [
Expand Down Expand Up @@ -235,7 +235,7 @@
"ver_code": 1
}
],
"device_id": "000000000000000000000000000000000000000000"
"device_id": "000000000000000000000000000000000000000002"
},
{
"component_list": [
Expand Down Expand Up @@ -300,7 +300,7 @@
"ver_code": 1
}
],
"device_id": "000000000000000000000000000000000000000000"
"device_id": "000000000000000000000000000000000000000003"
}
],
"start_index": 0,
Expand All @@ -315,7 +315,7 @@
"default_states": {
"type": "last_states"
},
"device_id": "000000000000000000000000000000000000000000",
"device_id": "000000000000000000000000000000000000000001",
"device_on": true,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.7 Build 220715 Rel.200458",
Expand Down Expand Up @@ -344,7 +344,7 @@
"default_states": {
"type": "last_states"
},
"device_id": "000000000000000000000000000000000000000000",
"device_id": "000000000000000000000000000000000000000002",
"device_on": true,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.7 Build 220715 Rel.200458",
Expand Down Expand Up @@ -373,7 +373,7 @@
"default_states": {
"type": "last_states"
},
"device_id": "000000000000000000000000000000000000000000",
"device_id": "000000000000000000000000000000000000000003",
"device_on": true,
"fw_id": "00000000000000000000000000000000",
"fw_ver": "1.0.7 Build 220715 Rel.200458",
Expand Down