diff options
Diffstat (limited to 'smart_home/lights.py')
| -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: |
