8000 Add TC65 fixture (#1200) · python-kasa/python-kasa@0287606 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0287606

Browse files
authored
Add TC65 fixture (#1200)
1 parent c051e75 commit 0287606

File tree

3 files changed

+646
-6
lines changed

3 files changed

+646
-6
lines changed

devtools/dump_devinfo.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,12 +987,14 @@ async def get_smart_fixtures(
987987
copy_folder = SMART_FOLDER
988988
else:
989989
# smart camera protocol
990-
hw_version = final["getDeviceInfo"]["device_info"]["basic_info"]["hw_version"]
991-
sw_version = final["getDeviceInfo"]["device_info"]["basic_info"]["sw_version"]
992-
model = final["getDeviceInfo"]["device_info"]["basic_info"]["device_model"]
993-
region = final["getDeviceInfo"]["device_info"]["basic_info"]["region"]
990+
basic_info = final["getDeviceInfo"]["device_info"]["basic_info"]
991+
hw_version = basic_info["hw_version"]
992+
sw_version = basic_info["sw_version"]
993+
model = basic_info["device_model"]
994+
region = basic_info.get("region")
994995
sw_version = sw_version.split(" ", maxsplit=1)[0]
995-
model = f"{model}({region})"
996+
if region is not None:
997+
model = f"{model}({region})"
996998
copy_folder = SMARTCAMERA_FOLDER
997999

9981000
save_filename = f"{model}_{hw_version}_{sw_version}.json"

kasa/experimental/smartcamera.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def _map_info(self, device_info: dict) -> dict:
142142
"fw_ver": basic_info["sw_version"],
143143
"hw_ver": basic_info["hw_version"],
144144
"mac": basic_info["mac"],
145-
"hwId": basic_info["hw_id"],
145+
"hwId": basic_info.get("hw_id"),
146146
"oem_id": basic_info["oem_id"],
147147
}
148148

0 commit comments

Comments
 (0)
0