mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix ZHA state restore by always restoring last seen on devices (#26271)
* fix state restore by always restoring last seen * cleanup
This commit is contained in:
parent
069e762da0
commit
bb52e17364
@ -304,6 +304,8 @@ class ZHAGateway:
|
||||
manufacturer=zha_device.manufacturer,
|
||||
model=zha_device.model,
|
||||
)
|
||||
entry = self.zha_storage.async_get_or_create(zha_device)
|
||||
zha_device.async_update_last_seen(entry.last_seen)
|
||||
return zha_device
|
||||
|
||||
@callback
|
||||
@ -356,10 +358,6 @@ class ZHAGateway:
|
||||
)
|
||||
await self._async_device_joined(device, zha_device)
|
||||
|
||||
# This is real traffic from a device so lets update last seen on the entry
|
||||
entry = self.zha_storage.async_get_or_create(zha_device)
|
||||
zha_device.async_update_last_seen(entry.last_seen)
|
||||
|
||||
device_info = async_get_device_info(
|
||||
self._hass, zha_device, self.ha_device_registry
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user