mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Shelly switch to guard for shelly 2 in roller mode (#39886)
This commit is contained in:
parent
b49e6243d1
commit
35a9106a4b
@ -13,6 +13,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
|||||||
"""Set up switches for device."""
|
"""Set up switches for device."""
|
||||||
wrapper = hass.data[DOMAIN][config_entry.entry_id]
|
wrapper = hass.data[DOMAIN][config_entry.entry_id]
|
||||||
|
|
||||||
|
# In roller mode the relay blocks exist but do not contain required info
|
||||||
|
if wrapper.model == "SHSW-25" and wrapper.device.settings["mode"] != "relay":
|
||||||
|
return
|
||||||
|
|
||||||
relay_blocks = [block for block in wrapper.device.blocks if block.type == "relay"]
|
relay_blocks = [block for block in wrapper.device.blocks if block.type == "relay"]
|
||||||
|
|
||||||
if not relay_blocks:
|
if not relay_blocks:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user