X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=smart_home%2Fregistry.py;h=75fe05256cc9f51cdc06a497fe9304917a510218;hb=a38d345b8b9348bab10c3e359997aadad814a6a1;hp=23584e119173e00f8d86dd38858126a990222f39;hpb=5f75cf834725ac26b289cc5f157af0cb71cd5f0e;p=python_utils.git diff --git a/smart_home/registry.py b/smart_home/registry.py index 23584e1..75fe052 100644 --- a/smart_home/registry.py +++ b/smart_home/registry.py @@ -63,7 +63,8 @@ class SmartHomeRegistry(object): try: (mac, name, keywords) = line.split(",") except ValueError: - logger.warning(f'SH-CONFIG> {line} is malformed?!') + msg = f'SH-CONFIG> "{line}" is malformed?! Skipping it.' + logger.warning(msg) continue mac = mac.strip() name = name.strip() @@ -183,11 +184,10 @@ class SmartHomeRegistry(object): logger.debug(' ...an unknown device (should this be here?)') return device.Device(name, mac, kws) except Exception as e: - logger.warning( - f'Got exception {e} while trying to communicate with device {name}/{mac}.' - ) + logger.exception(e) return device.Device(name, mac, kws) - logger.warning(f'{mac} is not a known smart home device, returning None') + msg = f'{mac} is not a known smart home device, returning None' + logger.warning(msg) return None def query(self, query: str) -> List[device.Device]: