Filter out disconnected Shelly sensors (#39516)
This commit is contained in:
parent
963651d6f2
commit
aa476b392c
1 changed files with 2 additions and 1 deletions
|
@ -37,7 +37,8 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||
|
||||
for block in wrapper.device.blocks:
|
||||
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
|
||||
|
||||
sensors.append(ShellySensor(wrapper, block, attr))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue