summaryrefslogtreecommitdiff
path: root/smart_home/lights.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-06 12:13:34 -0800
committerScott <[email protected]>2022-01-06 12:13:34 -0800
commit5f75cf834725ac26b289cc5f157af0cb71cd5f0e (patch)
treef31baf4247a7d29eb1457a74f75d373d10539237 /smart_home/lights.py
parentba223f821df1e9b8abbb6f6d23d5ba92c5a70b05 (diff)
A bunch of changes...
Diffstat (limited to 'smart_home/lights.py')
-rw-r--r--smart_home/lights.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/smart_home/lights.py b/smart_home/lights.py
index 1c4081c..e23569a 100644
--- a/smart_home/lights.py
+++ b/smart_home/lights.py
@@ -318,7 +318,10 @@ class TPLinkLight(BaseLight):
@overrides
def is_on(self) -> bool:
- return self.get_on_duration_seconds() > 0
+ self.info = self.get_info()
+ if self.info is None:
+ raise Exception('Unable to get info?')
+ return self.info.get("relay_state", "0") == "1"
@overrides
def is_off(self) -> bool: