From 4fbd4957bdbcca9def1060c5c2bc459dd4fac1e0 Mon Sep 17 00:00:00 2001 From: Shay Levy Date: Tue, 15 Sep 2020 17:29:24 +0300 Subject: [PATCH] Guard both Shelly 2 & Shelly 2.5 in roller mode (#40086) Co-authored-by: Maciej Bieniek --- homeassistant/components/shelly/switch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/shelly/switch.py b/homeassistant/components/shelly/switch.py index 0aaa6dbc911..0dcefb51cf9 100644 --- a/homeassistant/components/shelly/switch.py +++ b/homeassistant/components/shelly/switch.py @@ -14,7 +14,10 @@ async def async_setup_entry(hass, config_entry, async_add_entities): 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": + if ( + wrapper.model in ["SHSW-21", "SHSW-25"] + and wrapper.device.settings["mode"] != "relay" + ): return relay_blocks = [block for block in wrapper.device.blocks if block.type == "relay"]