Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard both Shelly 2 & Shelly 2.5 in roller mode #40086

Merged
merged 2 commits into from
Sep 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion homeassistant/components/shelly/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down