mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix Shelly battery powered devices unavailable (#65031)
This commit is contained in:
parent
290a0df2be
commit
25ffda7cd4
@ -562,6 +562,11 @@ class ShellySleepingBlockAttributeEntity(ShellyBlockAttributeEntity, RestoreEnti
|
|||||||
self.block: Block | None = block # type: ignore[assignment]
|
self.block: Block | None = block # type: ignore[assignment]
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
|
|
||||||
|
self._attr_should_poll = False
|
||||||
|
self._attr_device_info = DeviceInfo(
|
||||||
|
connections={(device_registry.CONNECTION_NETWORK_MAC, wrapper.mac)}
|
||||||
|
)
|
||||||
|
|
||||||
if block is not None:
|
if block is not None:
|
||||||
self._attr_unique_id = f"{self.wrapper.mac}-{block.description}-{attribute}"
|
self._attr_unique_id = f"{self.wrapper.mac}-{block.description}-{attribute}"
|
||||||
self._attr_name = get_block_entity_name(
|
self._attr_name = get_block_entity_name(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user