mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Filter out disconnected Shelly sensors (#39516)
This commit is contained in:
parent
963651d6f2
commit
aa476b392c
@ -37,7 +37,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
|
|
||||||
for block in wrapper.device.blocks:
|
for block in wrapper.device.blocks:
|
||||||
for attr in SENSORS:
|
for attr in SENSORS:
|
||||||
if not hasattr(block, attr):
|
# Filter out non-existing sensors and sensors without a value
|
||||||
|
if getattr(block, attr, None) is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
sensors.append(ShellySensor(wrapper, block, attr))
|
sensors.append(ShellySensor(wrapper, block, attr))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user