diff options
| author | Scott <[email protected]> | 2022-01-18 13:41:12 -0800 |
|---|---|---|
| committer | Scott <[email protected]> | 2022-01-18 13:41:12 -0800 |
| commit | 07a9659282a6b7c7776eec85f0708de9f8815374 (patch) | |
| tree | 40a23069fa1a42efda30362a1254808872f83ff5 /smart_home | |
| parent | 87f478b20c8b24eed6c1e87de47ba01e3d9746ab (diff) | |
Fix state determination in tplink kasa lights.
Diffstat (limited to 'smart_home')
| -rw-r--r-- | smart_home/lights.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/smart_home/lights.py b/smart_home/lights.py index 237d4e0..64f2105 100644 --- a/smart_home/lights.py +++ b/smart_home/lights.py @@ -323,7 +323,7 @@ class TPLinkLight(BaseLight): self.info = self.get_info() if self.info is None: raise Exception('Unable to get info?') - return self.info.get("relay_state", "0") == "1" + return self.info.get("relay_state", 0) == 1 @overrides def is_off(self) -> bool: @@ -344,6 +344,7 @@ class TPLinkLight(BaseLight): out = re.sub("Received: *", "", out) try: self.info = json.loads(out)["system"]["get_sysinfo"] + logger.debug(json.dumps(self.info, indent=4, sort_keys=True)) self.info_ts = datetime.datetime.now() return self.info except Exception as e: |
