mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
Filter out disconnected Shelly sensors (#39516)
This commit is contained in:
@@ -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))
|
||||||
|
Reference in New Issue
Block a user