projects
/
python_utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3794ba4
)
Fix tplink outlets with children is_on to check the children.
author
Scott Gasch
<
[email protected]
>
Tue, 7 Jun 2022 16:04:44 +0000
(09:04 -0700)
committer
Scott Gasch
<
[email protected]
>
Tue, 7 Jun 2022 16:04:44 +0000
(09:04 -0700)
smart_home/outlets.py
patch
|
blob
|
history
diff --git
a/smart_home/outlets.py
b/smart_home/outlets.py
index fcc3c4eb8f7fa74d428d31c7ebe4814c5cb11cbd..0b4538c13b4c45acf6e4acf199549b896e3a8afb 100644
(file)
--- a/
smart_home/outlets.py
+++ b/
smart_home/outlets.py
@@
-185,6
+185,15
@@
class TPLinkOutletWithChildren(TPLinkOutlet):
return int(chi.get("on_time", "0"))
return 0
+ @overrides
+ def get_on_duration_seconds(self) -> int:
+ self.info = self.get_info()
+ if self.info is not None:
+ for child in self.info["children"]:
+ if int(child["on_time"]) > 0:
+ return True
+ return False
+
class GoogleOutlet(BaseOutlet):
"""A smart outlet controlled via Google Assistant."""