mirror of
https://github.com/home-assistant/core.git
synced 2025-08-15 18:41:44 +02: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:
committed by
Paulus Schoutsen
parent
24a4a42664
commit
25961df548
@@ -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
|
||||
)
|
||||
|
Reference in New Issue
Block a user