diff options
| author | Scott Gasch <[email protected]> | 2022-02-26 11:15:31 -0800 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2022-02-26 11:15:31 -0800 |
| commit | 4863b00af3b2ddcfaa2e5f47fd6dd7e95c1eb6c5 (patch) | |
| tree | 438cd64bae8c3522275e8cb7340c09aa4898b8d2 /smart_home/lights.py | |
| parent | 84b6592ce26c6716d7cce86caa70a27862c293a3 (diff) | |
More work on tplink utils to avoid having to call tplink.py.
Diffstat (limited to 'smart_home/lights.py')
| -rw-r--r-- | smart_home/lights.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/smart_home/lights.py b/smart_home/lights.py index 096e0de..9a5a231 100644 --- a/smart_home/lights.py +++ b/smart_home/lights.py @@ -315,13 +315,15 @@ class TPLinkLight(BaseLight): raise NotImplementedError def get_info(self) -> Optional[Dict]: - cmd = self.get_cmdline() + "-c info" - self.info = tplink.tplink_get_info(cmd) - if self.info is not None: - self.info_ts = datetime.datetime.now() - else: - self.info_ts = None - return self.info + ip = self.get_ip() + if ip is not None: + self.info = tplink.tplink_get_info(ip) + if self.info is not None: + self.info_ts = datetime.datetime.now() + else: + self.info_ts = None + return self.info + return None @overrides def status(self) -> str: |
