diff --git a/README.md b/README.md index 27f375f7..9ba0d636 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,7 @@ The following devices have been tested and confirmed as working. If your device ### Supported Tapo[^1] devices -- **Plugs**: P100, P105, P110, P110M, P115, P125M, P135, TP10, TP15 +- **Plugs**: P100, P105, P110, P110M, P115, P116M, P125M, P135, TP10, TP15 - **Power Strips**: P210M, P300, P304M, P306, P316M, TP25 - **Wall Switches**: S210, S220, S500, S500D, S505, S505D, S515D, TS15 - **Bulbs**: L430C, L430P, L510B, L510E, L530B, L530E, L530EA, L535E, L630 diff --git a/SUPPORTED.md b/SUPPORTED.md index b4da209f..dbd0fa73 100644 --- a/SUPPORTED.md +++ b/SUPPORTED.md @@ -219,6 +219,8 @@ All Tapo devices require authentication.
Hub-Connected Devices may work acros - **P115** - Hardware: 1.0 (EU) / Firmware: 1.2.3 - Hardware: 1.0 (US) / Firmware: 1.1.3 +- **P116M** + - Hardware: 1.0 (IN) / Firmware: 1.4.4 - **P125M** - Hardware: 1.0 (US) / Firmware: 1.1.0 - Hardware: 1.0 (US) / Firmware: 1.4.4 diff --git a/tests/device_fixtures.py b/tests/device_fixtures.py index 6543a458..32f75049 100644 --- a/tests/device_fixtures.py +++ b/tests/device_fixtures.py @@ -99,6 +99,7 @@ PLUGS_SMART = { "P100", "P110", "P110M", + "P116M", "P115", "KP125M", "EP25", @@ -158,7 +159,16 @@ THERMOSTATS_SMART = {"KE100", "KE110"} VACUUMS_SMART = {"RV20"} WITH_EMETER_IOT = {"EP25", "HS110", "HS300", "KP115", "KP125", *BULBS_IOT} -WITH_EMETER_SMART = {"P110", "P110M", "P115", "KP125M", "EP25", "P304M", "S515D"} +WITH_EMETER_SMART = { + "P110", + "P110M", + "P116M", + "P115", + "KP125M", + "EP25", + "P304M", + "S515D", +} WITH_EMETER = {*WITH_EMETER_IOT, *WITH_EMETER_SMART} DIMMABLE = {*BULBS, *DIMMERS} diff --git a/tests/fixtures/smart/P116M(IN)_1.0_1.4.4.json b/tests/fixtures/smart/P116M(IN)_1.0_1.4.4.json new file mode 100644 index 00000000..54796c7d --- /dev/null +++ b/tests/fixtures/smart/P116M(IN)_1.0_1.4.4.json @@ -0,0 +1,467 @@ +{ + "component_nego": { + "component_list": [ + { + "id": "device", + "ver_code": 2 + }, + { + "id": "firmware", + "ver_code": 2 + }, + { + "id": "quick_setup", + "ver_code": 3 + }, + { + "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": "auto_off", + "ver_code": 2 + }, + { + "id": "localSmart", + "ver_code": 1 + }, + { + "id": "energy_unit", + "ver_code": 1 + }, + { + "id": "energy_monitoring", + "ver_code": 2 + }, + { + "id": "power_protection", + "ver_code": 1 + }, + { + "id": "charging_protection", + "ver_code": 2 + }, + { + "id": "matter", + "ver_code": 3 + }, + { + "id": "current_protection", + "ver_code": 1 + }, + { + "id": "bccp", + "ver_code": 1 + }, + { + "id": "realtime_emeter", + "ver_code": 1 + } + ] + }, + "discovery_result": { + "error_code": 0, + "result": { + "device_id": "00000000000000000000000000000000", + "device_model": "P116M(IN)", + "device_type": "SMART.TAPOPLUG", + "factory_default": false, + "ip": "127.0.0.123", + "is_support_iot_cloud": true, + "mac": "20-E1-5D-00-00-00", + "mgt_encrypt_schm": { + "encrypt_type": "KLAP", + "http_port": 80, + "is_support_https": false, + "lv": 2 + }, + "obd_src": "tplink", + "owner": "00000000000000000000000000000000", + "protocol_version": 1 + } + }, + "get_antitheft_rules": { + "antitheft_rule_max_count": 1, + "enable": false, + "rule_list": [] + }, + "get_auto_off_config": { + "delay_min": 120, + "enable": false + }, + "get_auto_update_info": { + "enable": true, + "random_range": 120, + "time": 180 + }, + "get_connect_cloud_state": { + "status": 0 + }, + "get_countdown_rules": { + "countdown_rule_max_count": 1, + "enable": false, + "rule_list": [] + }, + "get_current_power": { + "current_power": 20 + }, + "get_device_info": { + "auto_off_remain_time": 0, + "auto_off_status": "off", + "avatar": "house", + "charging_status": "normal", + "cloud_proxy": false, + "default_states": { + "type": "last_states" + }, + "device_id": "0000000000000000000000000000000000000000", + "device_on": true, + "fw_id": "00000000000000000000000000000000", + "fw_ver": "1.4.4 Build 260206 Rel.132552", + "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": "20-E1-5D-00-00-00", + "model": "P116M", + "nickname": "I01BU0tFRF9OQU1FIw==", + "oem_id": "00000000000000000000000000000000", + "on_time": 39762, + "overcurrent_status": "normal", + "power_protection_status": "normal", + "region": "Asia/Kolkata", + "rssi": -64, + "signal_level": 2, + "specs": "IN", + "ssid": "I01BU0tFRF9TU0lEIw==", + "time_diff": 330, + "type": "SMART.TAPOPLUG" + }, + "get_device_time": { + "region": "Asia/Kolkata", + "time_diff": 330, + "timestamp": 1791827811 + }, + "get_device_usage": { + "power_usage": { + "past30": 869, + "past30_mwh": 869102, + "past7": 869, + "past7_mwh": 869102, + "today": 259, + "today_mwh": 258767 + }, + "saved_power": { + "past30": 1497, + "past30_mwh": 1496898, + "past7": 1497, + "past7_mwh": 1496898, + "today": 478, + "today_mwh": 478233 + }, + "time_usage": { + "past30": 2366, + "past7": 2366, + "today": 737 + } + }, + "get_electricity_price_config": { + "constant_price": 0, + "time_of_use_config": { + "summer": { + "midpeak": 0, + "offpeak": 0, + "onpeak": 0, + "period": [ + 0, + 0, + 0, + 0 + ], + "weekday_config": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "weekend_config": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + }, + "winter": { + "midpeak": 0, + "offpeak": 0, + "onpeak": 0, + "period": [ + 0, + 0, + 0, + 0 + ], + "weekday_config": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + "weekend_config": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ] + } + }, + "type": "constant" + }, + "get_emeter_data": { + "current_ma": 170, + "energy_mwh": 562069, + "energy_wh": 562, + "power_mw": 20500, + "voltage_mv": 235953 + }, + "get_emeter_vgain_igain": { + "igain": 11269, + "vgain": 123296 + }, + "get_energy_usage": { + "current_power": 20500, + "electricity_charge": [ + 0, + 0, + 0 + ], + "local_time": "2026-10-12 23:26:51", + "month_energy": 869, + "month_energy_mwh": 869106, + "month_runtime": 2366, + "today_energy": 259, + "today_energy_mwh": 258771, + "today_runtime": 737 + }, + "get_fw_download_state": { + "auto_upgrade": false, + "download_progress": 0, + "reboot_time": 5, + "status": 0, + "upgrade_time": 5 + }, + "get_latest_fw": { + "fw_size": 0, + "fw_ver": "1.4.4 Build 260206 Rel.132552", + "hw_id": "", + "need_to_upgrade": false, + "oem_id": "", + "release_date": "", + "release_note": "", + "type": 0 + }, + "get_led_info": { + "led_rule": "always", + "led_status": true, + "night_mode": { + "end_time": 420, + "night_mode_type": "custom", + "start_time": 1320 + } + }, + "get_matter_setup_info": { + "setup_code": "00000000000", + "setup_payload": "00:0000000000000000000" + }, + "get_max_power": { + "max_power": 1363 + }, + "get_next_event": {}, + "get_protection_power": { + "enabled": false, + "protection_power": 0 + }, + "get_schedule_rules": { + "enable": false, + "rule_list": [], + "schedule_rule_max_count": 32, + "start_index": 0, + "sum": 0 + }, + "get_wireless_scan_info": { + "ap_list": [], + "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": "bccp", + "ver_code": 1 + }, + { + "id": "matter", + "ver_code": 3 + }, + { + "id": "iot_cloud", + "ver_code": 1 + }, + { + "id": "inherit", + "ver_code": 1 + }, + { + "id": "firmware", + "ver_code": 2 + } + ], + "extra_info": { + "device_model": "P116M", + "device_type": "SMART.TAPOPLUG", + "is_klap": true + } + } +}