Support MyStrom switch 120 (#96535)
parent
357af58c81
commit
1b7632a673
|
@ -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"])
|
||||
|
@ -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)
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue