From 62f1a169182008eda4ee1e0ddce544b96ae7ae69 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Sat, 2 Oct 2021 16:31:23 +0200 Subject: [PATCH] Add sleep_period to log for easier debugging (#56949) --- homeassistant/components/shelly/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/shelly/__init__.py b/homeassistant/components/shelly/__init__.py index ad0ad5f4387..b0df4d4cb7f 100644 --- a/homeassistant/components/shelly/__init__.py +++ b/homeassistant/components/shelly/__init__.py @@ -320,9 +320,11 @@ class BlockDeviceWrapper(update_coordinator.DataUpdateCoordinator): async def _async_update_data(self) -> None: """Fetch data.""" - if self.entry.data.get("sleep_period"): + if sleep_period := self.entry.data.get("sleep_period"): # Sleeping device, no point polling it, just mark it unavailable - raise update_coordinator.UpdateFailed("Sleeping device did not update") + raise update_coordinator.UpdateFailed( + f"Sleeping device did not update within {sleep_period} seconds interval" + ) _LOGGER.debug("Polling Shelly Block Device - %s", self.name) try: