projects
/
python_utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleanup config in preparation for zookeeper-based dynamic configs.
[python_utils.git]
/
smart_home
/
chromecasts.py
diff --git
a/smart_home/chromecasts.py
b/smart_home/chromecasts.py
index bec8461a4d764ce97a812f1af08f4a5087fd8869..3bd45f126e07e6f60d0251bd7249703f21f0aad7 100644
(file)
--- a/
smart_home/chromecasts.py
+++ b/
smart_home/chromecasts.py
@@
-1,6
+1,8
@@
#!/usr/bin/env python3
#!/usr/bin/env python3
-"""Utilities for dealing with the webcams."""
+# © Copyright 2021-2022, Scott Gasch
+
+"""Utilities for dealing with the chromecasts."""
import atexit
import datetime
import atexit
import datetime
@@
-17,6
+19,8
@@
logger = logging.getLogger(__name__)
class BaseChromecast(dev.Device):
class BaseChromecast(dev.Device):
+ """A base class to represent a Google Chromecase device."""
+
ccasts: List[Any] = []
refresh_ts = None
browser = None
ccasts: List[Any] = []
refresh_ts = None
browser = None
@@
-45,13
+49,11
@@
class BaseChromecast(dev.Device):
self.cast = None
for cc in BaseChromecast.ccasts:
if cc.cast_info.host == ip and cc.cast_info.cast_type != 'group':
self.cast = None
for cc in BaseChromecast.ccasts:
if cc.cast_info.host == ip and cc.cast_info.cast_type != 'group':
- logger.debug(
f'Found chromecast at {ip}: {cc}'
)
+ logger.debug(
'Found chromecast at %s: %s', ip, cc
)
self.cast = cc
self.cast.wait(timeout=1.0)
if self.cast is None:
self.cast = cc
self.cast.wait(timeout=1.0)
if self.cast is None:
- raise Exception(
- f'Can\'t find ccast device at {ip}, is that really a ccast device?'
- )
+ raise Exception(f'Can\'t find ccast device at {ip}, is that really a ccast device?')
def is_idle(self):
return self.cast.is_idle
def is_idle(self):
return self.cast.is_idle