mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Log device info in Broadlink error messages (#41307)
This commit is contained in:
parent
c812812631
commit
34416fcad3
@ -48,7 +48,7 @@ class BroadlinkUpdateManager(ABC):
|
|||||||
self.coordinator = DataUpdateCoordinator(
|
self.coordinator = DataUpdateCoordinator(
|
||||||
device.hass,
|
device.hass,
|
||||||
_LOGGER,
|
_LOGGER,
|
||||||
name="device",
|
name=f"{device.name} ({device.api.model} at {device.api.host[0]})",
|
||||||
update_method=self.async_update,
|
update_method=self.async_update,
|
||||||
update_interval=timedelta(minutes=1),
|
update_interval=timedelta(minutes=1),
|
||||||
)
|
)
|
||||||
@ -67,14 +67,20 @@ class BroadlinkUpdateManager(ABC):
|
|||||||
):
|
):
|
||||||
self.available = False
|
self.available = False
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Disconnected from the device at %s", self.device.api.host[0]
|
"Disconnected from %s (%s at %s)",
|
||||||
|
self.device.name,
|
||||||
|
self.device.api.model,
|
||||||
|
self.device.api.host[0],
|
||||||
)
|
)
|
||||||
raise UpdateFailed(err) from err
|
raise UpdateFailed(err) from err
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if self.available is False:
|
if self.available is False:
|
||||||
_LOGGER.warning(
|
_LOGGER.warning(
|
||||||
"Connected to the device at %s", self.device.api.host[0]
|
"Connected to %s (%s at %s)",
|
||||||
|
self.device.name,
|
||||||
|
self.device.api.model,
|
||||||
|
self.device.api.host[0],
|
||||||
)
|
)
|
||||||
self.available = True
|
self.available = True
|
||||||
self.last_update = dt.utcnow()
|
self.last_update = dt.utcnow()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user