X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=smart_home%2Flights.py;fp=smart_home%2Flights.py;h=64f2105ffe8a4de0864e95a14d2b05703010a2bb;hb=07a9659282a6b7c7776eec85f0708de9f8815374;hp=237d4e0d93b6c294a13eb95a504d2e125738725c;hpb=87f478b20c8b24eed6c1e87de47ba01e3d9746ab;p=python_utils.git 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: