Skip to content

Commit

Permalink
Added logging to the setup process
Browse files Browse the repository at this point in the history
  • Loading branch information
sockless-coding committed Sep 23, 2024
1 parent 9a5ddc3 commit be73379
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions custom_components/panasonic_cc/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ async def _create_device(self, username, password):
await api.start_session()
devices = api.get_devices()

if api.has_unknown_devices:
_LOGGER.warning(f"""Found {len(api.unknown_devices)} unknown device(s):
{"\n ".join(obj.raw for obj in api.unknown_devices)}
Submit this log to https://github.com/sockless-coding/panasonic_cc/issues/310
""")
for device in api.unknown_devices:
try:
json = await api.get_aquarea_device(device)
_LOGGER.warning(f"""Got aquarea device info for: {device.raw}:
{json}
Submit this log to https://github.com/sockless-coding/panasonic_cc/issues/310""")
except Exception as e:
_LOGGER.warning(f"""Failed to get aquarea device info for {device.raw}
Submit this log to https://github.com/sockless-coding/panasonic_cc/issues/310""", exc_info=e)

if not devices:
_LOGGER.debug("Not devices found")
return self.async_abort(reason="No devices")
Expand Down

0 comments on commit be73379

Please sign in to comment.