X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=smart_home%2Fchromecasts.py;h=dd6d217e3d4ce3d9a79cf4b42f930ab5e993e0e8;hb=d1f18fdf430eee4292938dd18b922d6d6e05e18c;hp=bec8461a4d764ce97a812f1af08f4a5087fd8869;hpb=7ff2af6fe7bffea90dc4a31c93140c189917c659;p=python_utils.git diff --git a/smart_home/chromecasts.py b/smart_home/chromecasts.py index bec8461..dd6d217 100644 --- a/smart_home/chromecasts.py +++ b/smart_home/chromecasts.py @@ -17,6 +17,8 @@ logger = logging.getLogger(__name__) class BaseChromecast(dev.Device): + """A base class to represent a Google Chromecase device.""" + ccasts: List[Any] = [] refresh_ts = None browser = None @@ -45,13 +47,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': - 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: - 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