Skip to content

Commit

Permalink
Support MyStrom switch 120 (#96535)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek committed Jul 14, 2023
1 parent 357af58 commit 1b7632a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/mystrom/__init__.py
Expand Up @@ -53,7 +53,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
info.setdefault("type", 101)

device_type = info["type"]
if device_type in [101, 106, 107]:
if device_type in [101, 106, 107, 120]:
device = _get_mystrom_switch(host)
platforms = PLATFORMS_SWITCH
await _async_get_device_state(device, info["ip"])
Expand Down Expand Up @@ -86,7 +86,7 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
device_type = hass.data[DOMAIN][entry.entry_id].info["type"]
platforms = []
if device_type in [101, 106, 107]:
if device_type in [101, 106, 107, 120]:
platforms.extend(PLATFORMS_SWITCH)
elif device_type in [102, 105]:
platforms.extend(PLATFORMS_BULB)
Expand Down
2 changes: 1 addition & 1 deletion tests/components/mystrom/test_init.py
Expand Up @@ -68,7 +68,7 @@ async def test_init_switch_and_unload(
(110, "sensor", ConfigEntryState.SETUP_ERROR, True),
(113, "switch", ConfigEntryState.SETUP_ERROR, True),
(118, "button", ConfigEntryState.SETUP_ERROR, True),
(120, "switch", ConfigEntryState.SETUP_ERROR, True),
(120, "switch", ConfigEntryState.LOADED, False),
],
)
async def test_init_bulb(
Expand Down

0 comments on commit 1b7632a

Please sign in to comment.