From 677ef9c3ef621e2782694ef4ab88446bd580d5ff Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 22 Jul 2023 16:55:42 -0500 Subject: [PATCH] Add tests for KP200 (#483) * Add tests for KP200 This one worked out of the box sans the OUI not being in the list https://github.com/home-assistant/core/pull/97062 * it is a strip --- README.md | 1 + kasa/tests/conftest.py | 2 +- kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json | 46 ++++++++++++++++++++ 3 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json diff --git a/README.md b/README.md index 0232eee1..00063dc1 100644 --- a/README.md +++ b/README.md @@ -145,6 +145,7 @@ If your device is unlisted but working, please open a pull request to update the * EP40 * HS300 * KP303 +* KP200 (in wall) * KP400 * KP405 (dimmer) diff --git a/kasa/tests/conftest.py b/kasa/tests/conftest.py index 4ea9846e..9b5a394d 100644 --- a/kasa/tests/conftest.py +++ b/kasa/tests/conftest.py @@ -55,7 +55,7 @@ PLUGS = { "KP401", "KS200M", } -STRIPS = {"HS107", "HS300", "KP303", "KP400", "EP40"} +STRIPS = {"HS107", "HS300", "KP303", "KP200", "KP400", "EP40"} DIMMERS = {"ES20M", "HS220", "KS220M", "KS230", "KP405"} DIMMABLE = {*BULBS, *DIMMERS} diff --git a/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json b/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json new file mode 100644 index 00000000..fef495d6 --- /dev/null +++ b/kasa/tests/fixtures/KP200(US)_3.0_1.0.3.json @@ -0,0 +1,46 @@ +{ + "system": { + "get_sysinfo": { + "alias": "TP-LINK_Smart Plug_C2D6", + "child_num": 2, + "children": [ + { + "alias": "One ", + "id": "80066788DFFFD572D9F2E4A5A6847669213E039F00", + "next_action": { + "type": -1 + }, + "on_time": 43, + "state": 1 + }, + { + "alias": "Two ", + "id": "80066788DFFFD572D9F2E4A5A6847669213E039F01", + "next_action": { + "type": -1 + }, + "on_time": 44, + "state": 1 + } + ], + "deviceId": "0000000000000000000000000000000000000000", + "err_code": 0, + "feature": "TIM", + "hwId": "00000000000000000000000000000000", + "hw_ver": "3.0", + "latitude_i": 0, + "led_off": 0, + "longitude_i": 0, + "mac": "00:00:00:00:00:00", + "mic_type": "IOT.SMARTPLUGSWITCH", + "model": "KP200(US)", + "ntc_state": 0, + "obd_src": "tplink", + "oemId": "00000000000000000000000000000000", + "rssi": -50, + "status": "new", + "sw_ver": "1.0.3 Build 221021 Rel.183354", + "updating": 0 + } + } +}