Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
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
2 changes: 2 additions & 0 deletions 2 devtools/dump_devinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def cli(host, debug):
Call(
module="smartlife.iot.smartbulb.lightingservice", method="get_light_state"
),
Call(module="smartlife.iot.LAS", method="get_config"),
Call(module="smartlife.iot.PIR", method="get_config"),
]

successes = []
Expand Down
2 changes: 1 addition & 1 deletion 2 kasa/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"KP401",
}
STRIPS = {"HS107", "HS300", "KP303", "KP400", "EP40"}
DIMMERS = {"HS220"}
DIMMERS = {"HS220", "KS220M"}

DIMMABLE = {*BULBS, *DIMMERS}
WITH_EMETER = {"HS110", "HS300", "KP115", *BULBS}
Expand Down
126 changes: 126 additions & 0 deletions 126 kasa/tests/fixtures/KS220M(US)_1.0_1.0.4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"smartlife.iot.LAS": {
"get_config": {
"devs": [
{
"dark_index": 0,
"enable": 1,
"hw_id": 0,
"level_array": [
{
"adc": 490,
"name": "cloudy",
"value": 20
},
{
"adc": 294,
"name": "overcast",
"value": 12
},
{
"adc": 222,
"name": "dawn",
"value": 9
},
{
"adc": 222,
"name": "twilight",
"value": 9
},
{
"adc": 111,
"name": "total darkness",
"value": 4
},
{
"adc": 2400,
"name": "custom",
"value": 97
}
],
"max_adc": 2450,
"min_adc": 0
}
],
"err_code": 0,
"ver": "1.0"
}
},
"smartlife.iot.PIR": {
"get_config": {
"array": [
80,
50,
20,
61
],
"cold_time": 60000,
"enable": 1,
"err_code": 0,
"max_adc": 4095,
"min_adc": 0,
"trigger_index": 2,
"version": "1.0"
}
},
"smartlife.iot.dimmer": {
"get_dimmer_parameters": {
"bulb_type": 1,
"err_code": 0,
"fadeOffTime": 0,
"fadeOnTime": 0,
"gentleOffTime": 10000,
"gentleOnTime": 3000,
"minThreshold": 1,
"rampRate": 30
}
},
"system": {
"get_sysinfo": {
"active_mode": "none",
"alias": "Garage Entryway Lights",
"brightness": 100,
"dev_name": "Wi-Fi Smart Dimmer with sensor",
"deviceId": "0000000000000000000000000000000000000000",
"err_code": 0,
"feature": "TIM",
"hwId": "00000000000000000000000000000000",
"hw_ver": "1.0",
"icon_hash": "",
"latitude_i": 0,
"led_off": 0,
"longitude_i": 0,
"mac": "00:00:00:00:00:00",
"mic_type": "IOT.SMARTPLUGSWITCH",
"model": "KS220M(US)",
"next_action": {
"type": -1
},
"oemId": "00000000000000000000000000000000",
"on_time": 0,
"preferred_state": [
{
"brightness": 100,
"index": 0
},
{
"brightness": 75,
"index": 1
},
{
"brightness": 50,
"index": 2
},
{
"brightness": 25,
"index": 3
}
],
"relay_state": 0,
"rssi": -42,
"status": "new",
"sw_ver": "1.0.4 Build 210616 Rel.193517",
"updating": 0
}
}
}
2 changes: 2 additions & 0 deletions 2 kasa/tests/newfakes.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,8 @@ def light_state(self, x, *args):
"set_brightness": set_hs220_brightness,
"set_dimmer_transition": set_hs220_dimmer_transition,
},
"smartlife.iot.LAS": {},
"smartlife.iot.PIR": {},
}

async def query(self, request, port=9999):
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.