Add sleep_period to log for easier debugging (#56949)

This commit is contained in:
Simone Chemelli 2021-10-02 16:31:23 +02:00 committed by GitHub
parent f42c2f5170
commit 62f1a16918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: