FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Use the real discovery reply in the TD21 fixture by Smugaski · Pull Request #1800 · python-kasa/python-kasa · GitHub

Repository navigation

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

Filter by extension

Filter by extension .json  (1) .py  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 4 additions & 0 deletions tests/discovery_fixtures.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ def _datagram(self) -> bytes:
):
login_version = max([int(i) for i in et])
https = discovery_result["mgt_encrypt_schm"]["is_support_https"]
if not encrypt_type and https and login_version == 3:
# Mirrors Discover._get_connection_parameters for cameras that
# only send the top level encrypt_type list
encrypt_type = "AES"
http_port = discovery_result["mgt_encrypt_schm"].get("http_port")
if not http_port: # noqa: SIM108
# Not all discovery responses set the http port, i.e. smartcam.
Expand Down
59 changes: 27 additions & 32 deletions tests/fixtures/smartcam/TD21(EU)_2.0_1.1.5.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{
"discovery_result": {
"_comment": "Manually created, not a real device response.",
"error_code": 0,
"result": {
"battery_charging": false,
"battery_percent": 8,
"device_id": "00000000000000000000000000000000",
"device_model": "TD21",
"device_name": "#MASKED_NAME#",
"device_type": "SMART.TAPODOORBELL",
"encrypt_info": {
"data": "",
"key": "",
"sym_schm": "AES"
},
"encrypt_type": [
"3"
],
"factory_default": false,
"firmware_version": "1.1.5 Build 260423 Rel.6435n",
"hardware_version": "2.0",
"ip": "127.0.0.123",
"isResetWiFi": false,
"is_support_iot_cloud": true,
"last_alarm_time": 1791915611,
"lens_mask": "off",
"low_battery": true,
"mac": "C0-3A-55-00-00-00",
"mgt_encrypt_schm": {
"is_support_https": true
}
},
"owner": "00000000000000000000000000000000",
"power": "BATTERY",
"power_save_status": "off",
"protocol_version": 1,
"sd_status": "normal",
"sleep": true
}
},
"getAlertPlan": {
Expand Down Expand Up @@ -279,8 +282,8 @@
"getClockStatus": {
"system": {
"clock_status": {
"local_time": "2026-10-07 20:57:13",
"seconds_from_1970": 1791403033
"local_time": "2026-10-13 19:52:21",
"seconds_from_1970": 1791917541
}
}
},
Expand All @@ -294,8 +297,8 @@
"getConnectionType": {
"channel": 0,
"link_type": "wifi",
"rssi": "2",
"rssiValue": -64,
"rssi": "3",
"rssiValue": -61,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
"getDetectionConfig": {
Expand All @@ -318,7 +321,7 @@
"barcode": "",
"battery_charging": "NO",
"battery_overheated": false,
"battery_percent": 20,
"battery_percent": 7,
"channel_plan_code": "",
"dev_id": "0000000000000000000000000000000000000000",
"device_alias": "#MASKED_NAME#",
Expand Down Expand Up @@ -369,7 +372,7 @@
"getLastAlarmInfo": {
"system": {
"last_alarm_info": {
"last_alarm_time": "1791402993",
"last_alarm_time": "1791917500",
"last_alarm_type": "motion"
}
}
Expand Down Expand Up @@ -657,8 +660,8 @@
"crossline_total_space_accurate": "0B",
"detect_status": "normal",
"disk_name": "1",
"free_space": "28.0GB",
"free_space_accurate": "30047127744B",
"free_space": "27.8GB",
"free_space_accurate": "29887174540B",
"loop_record_status": "0",
"msg_push_free_space": "0B",
"msg_push_free_space_accurate": "0B",
Expand All @@ -677,8 +680,8 @@
"total_space": "29.5GB",
"total_space_accurate": "31638716416B",
"type": "local",
"video_free_space": "28.0GB",
"video_free_space_accurate": "30047127744B",
"video_free_space": "27.8GB",
"video_free_space_accurate": "29887174540B",
"video_total_space": "28.3GB",
"video_total_space_accurate": "30333206528B",
"write_protect": "0"
Expand Down Expand Up @@ -741,7 +744,7 @@
"getVideoQualities": {
"video": {
"main": {
"bitrate": "900",
"bitrate": "1500",
"bitrate_type": "vbr",
"codec_switch_trigger": "none",
"default_bitrate": "1500",
Expand Down Expand Up @@ -980,15 +983,15 @@
"scan": {
"ap_list": [
{
"auth": 3,
"auth": 0,
"bssid": "000000000000",
"channel": 0,
"encryption": 3,
"rssi": 2,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"auth": 0,
"auth": 3,
"bssid": "000000000000",
"channel": 0,
"encryption": 3,
Expand Down Expand Up @@ -1016,15 +1019,15 @@
"bssid": "000000000000",
"channel": 0,
"encryption": 3,
"rssi": 0,
"rssi": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"auth": 3,
"bssid": "000000000000",
"channel": 0,
"encryption": 3,
"rssi": 0,
"rssi": 1,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
Expand Down Expand Up @@ -1058,14 +1061,6 @@
"encryption": 3,
"rssi": 0,
"ssid": "I01BU0tFRF9TU0lEIw=="
},
{
"auth": 5,
"bssid": "000000000000",
"channel": 0,
"encryption": 3,
"rssi": 0,
"ssid": "I01BU0tFRF9TU0lEIw=="
}
],
"public_key": "-----BEGIN PUBLIC KEY-----\nMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC8rndtJFzDJrH5dJEUHfpwZ04O\nBCXYTegs75oDyqZC9To5shtOlH1cCyxR/y6OF2V/NYFU+PlJEaa1QvkFM7mxYRCv\n7A7j/KOmmseX6pOmILDlU7Mcii64kAKSrNrgEhILIvCvN3cBfb+jIm7G70YaIJ98\n+MaPNJGAoIhbHJT0dQIDAQAB\n-----END PUBLIC KEY-----\n",
Expand Down
Loading

Back | FazBrowse Home | New Git URL