| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -114,6 +114,7 @@ def scrub(res): | |||
| 114 | 114 | "connect_ssid", | |
| 115 | 115 | "encrypt_info", | |
| 116 | 116 | "local_ip", | |
| 117 | + "username", | ||
| 117 | 118 | ] | |
| 118 | 119 | ||
| 119 | 120 | for k, v in res.items(): | |
@@ -152,7 +153,7 @@ def scrub(res): | |||
| 152 | 153 | v = base64.b64encode(b"#MASKED_SSID#").decode() | |
| 153 | 154 | elif k in ["nickname"]: | |
| 154 | 155 | v = base64.b64encode(b"#MASKED_NAME#").decode() | |
| 155 | - elif k in ["alias", "device_alias", "device_name"]: | ||
| 156 | + elif k in ["alias", "device_alias", "device_name", "username"]: | ||
| 156 | 157 | v = "#MASKED_NAME#" | |
| 157 | 158 | elif isinstance(res[k], int): | |
| 158 | 159 | v = 0 | |
@@ -398,11 +399,25 @@ async def get_legacy_fixture( | |||
| 398 | 399 | items = [ | |
| 399 | 400 | Call(module="system", method="get_sysinfo"), | |
| 400 | 401 | Call(module="emeter", method="get_realtime"), | |
| 402 | + Call(module="cnCloud", method="get_info"), | ||
| 403 | + Call(module="cnCloud", method="get_intl_fw_list"), | ||
| 404 | + Call(module="smartlife.iot.common.schedule", method="get_next_action"), | ||
| 405 | + Call(module="smartlife.iot.common.schedule", method="get_rules"), | ||
| 406 | + Call(module="schedule", method="get_next_action"), | ||
| 407 | + Call(module="schedule", method="get_rules"), | ||
| 401 | 408 | Call(module="smartlife.iot.dimmer", method="get_dimmer_parameters"), | |
| 409 | + Call(module="smartlife.iot.dimmer", method="get_default_behavior"), | ||
| 402 | 410 | Call(module="smartlife.iot.common.emeter", method="get_realtime"), | |
| 403 | 411 | Call( | |
| 404 | 412 | module="smartlife.iot.smartbulb.lightingservice", method="get_light_state" | |
| 405 | 413 | ), | |
| 414 | + Call( | ||
| 415 | + module="smartlife.iot.smartbulb.lightingservice", | ||
| 416 | + method="get_default_behavior", | ||
| 417 | + ), | ||
| 418 | + Call( | ||
| 419 | + module="smartlife.iot.smartbulb.lightingservice", method="get_light_details" | ||
| 420 | + ), | ||
| 406 | 421 | Call(module="smartlife.iot.LAS", method="get_config"), | |
| 407 | 422 | Call(module="smartlife.iot.LAS", method="get_current_brt"), | |
| 408 | 423 | Call(module="smartlife.iot.PIR", method="get_config"), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -213,8 +213,9 @@ def _build_fake_proto(info): | |||
| 213 | 213 | for target in info: | |
| 214 | 214 | if target != "discovery_result": | |
| 215 | 215 | for cmd in info[target]: | |
| 216 | - # print("initializing tgt %s cmd %s" % (target, cmd)) | ||
| 217 | - proto[target][cmd] = info[target][cmd] | ||
| 216 | + # Use setdefault in case the fixture has modules not yet | ||
| 217 | + # part of the baseproto. | ||
| 218 | + proto.setdefault(target, {})[cmd] = info[target][cmd] | ||
| 218 | 219 | ||
| 219 | 220 | # if we have emeter support, we need to add the missing pieces | |
| 220 | 221 | for module in ["emeter", "smartlife.iot.common.emeter"]: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,82 @@ | |||
| 1 | 1 | { | |
| 2 | + "cnCloud": { | ||
| 3 | + "get_info": { | ||
| 4 | + "binded": 1, | ||
| 5 | + "cld_connection": 0, | ||
| 6 | + "err_code": 0, | ||
| 7 | + "fwDlPage": "", | ||
| 8 | + "fwNotifyType": -1, | ||
| 9 | + "illegalType": 0, | ||
| 10 | + "server": "n-devs.tplinkcloud.com", | ||
| 11 | + "stopConnect": 0, | ||
| 12 | + "tcspInfo": "", | ||
| 13 | + "tcspStatus": 1, | ||
| 14 | + "username": "#MASKED_NAME#" | ||
| 15 | + }, | ||
| 16 | + "get_intl_fw_list": { | ||
| 17 | + "err_code": -7, | ||
| 18 | + "err_msg": "unknown error" | ||
| 19 | + } | ||
| 20 | + }, | ||
| 21 | + "schedule": { | ||
| 22 | + "get_next_action": { | ||
| 23 | + "action": 1, | ||
| 24 | + "err_code": 0, | ||
| 25 | + "id": "0794F4729DB271627D1CF35A9A854030", | ||
| 26 | + "schd_time": 68927, | ||
| 27 | + "type": 2 | ||
| 28 | + }, | ||
| 29 | + "get_rules": { | ||
| 30 | + "enable": 1, | ||
| 31 | + "err_code": 0, | ||
| 32 | + "rule_list": [ | ||
| 33 | + { | ||
| 34 | + "eact": -1, | ||
| 35 | + "enable": 1, | ||
| 36 | + "id": "8AA75A50A8440B17941D192BD9E01FFA", | ||
| 37 | + "name": "name", | ||
| 38 | + "repeat": 1, | ||
| 39 | + "sact": 1, | ||
| 40 | + "smin": 1027, | ||
| 41 | + "soffset": 0, | ||
| 42 | + "stime_opt": 2, | ||
| 43 | + "wday": [ | ||
| 44 | + 1, | ||
| 45 | + 1, | ||
| 46 | + 1, | ||
| 47 | + 1, | ||
| 48 | + 1, | ||
| 49 | + 1, | ||
| 50 | + 1 | ||
| 51 | + ] | ||
| 52 | + }, | ||
| 53 | + { | ||
| 54 | + "eact": -1, | ||
| 55 | + "enable": 1, | ||
| 56 | + "id": "9F62073CF69D8645173412283AD63A2C", | ||
| 57 | + "name": "name", | ||
| 58 | + "repeat": 1, | ||
| 59 | + "sact": 0, | ||
| 60 | + "smin": 504, | ||
| 61 | + "soffset": 0, | ||
| 62 | + "stime_opt": 1, | ||
| 63 | + "wday": [ | ||
| 64 | + 1, | ||
| 65 | + 1, | ||
| 66 | + 1, | ||
| 67 | + 1, | ||
| 68 | + 1, | ||
| 69 | + 1, | ||
| 70 | + 1 | ||
| 71 | + ] | ||
| 72 | + } | ||
| 73 | + ], | ||
| 74 | + "version": 2 | ||
| 75 | + } | ||
| 76 | + }, | ||
| 2 | 77 | "system": { | |
| 3 | 78 | "get_sysinfo": { | |
| 4 | - "active_mode": "schedule", | ||
| 79 | + "active_mode": "count_down", | ||
| 5 | 80 | "alias": "#MASKED_NAME#", | |
| 6 | 81 | "dev_name": "Smart Wi-Fi Plug", | |
| 7 | 82 | "deviceId": "0000000000000000000000000000000000000000", | |
@@ -18,16 +93,16 @@ | |||
| 18 | 93 | "model": "KP105(UK)", | |
| 19 | 94 | "next_action": { | |
| 20 | 95 | "action": 1, | |
| 21 | - "id": "8AA75A50A8440B17941D192BD9E01FFA", | ||
| 22 | - "schd_sec": 59160, | ||
| 23 | - "type": 1 | ||
| 96 | + "id": "0794F4729DB271627D1CF35A9A854030", | ||
| 97 | + "schd_sec": 68927, | ||
| 98 | + "type": 2 | ||
| 24 | 99 | }, | |
| 25 | 100 | "ntc_state": 0, | |
| 26 | 101 | "obd_src": "tplink", | |
| 27 | 102 | "oemId": "00000000000000000000000000000000", | |
| 28 | - "on_time": 0, | ||
| 29 | - "relay_state": 0, | ||
| 30 | - "rssi": -66, | ||
| 103 | + "on_time": 7138, | ||
| 104 | + "relay_state": 1, | ||
| 105 | + "rssi": -77, | ||
| 31 | 106 | "status": "configured", | |
| 32 | 107 | "sw_ver": "1.0.5 Build 191209 Rel.094735", | |
| 33 | 108 | "updating": 0 | |
| Back | FazBrowse Home | New Git URL |
0 commit comments