mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Support MyStrom switch 120 (#96535)
This commit is contained in:
parent
357af58c81
commit
1b7632a673
@ -53,7 +53,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
info.setdefault("type", 101)
|
info.setdefault("type", 101)
|
||||||
|
|
||||||
device_type = info["type"]
|
device_type = info["type"]
|
||||||
if device_type in [101, 106, 107]:
|
if device_type in [101, 106, 107, 120]:
|
||||||
device = _get_mystrom_switch(host)
|
device = _get_mystrom_switch(host)
|
||||||
platforms = PLATFORMS_SWITCH
|
platforms = PLATFORMS_SWITCH
|
||||||
await _async_get_device_state(device, info["ip"])
|
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."""
|
"""Unload a config entry."""
|
||||||
device_type = hass.data[DOMAIN][entry.entry_id].info["type"]
|
device_type = hass.data[DOMAIN][entry.entry_id].info["type"]
|
||||||
platforms = []
|
platforms = []
|
||||||
if device_type in [101, 106, 107]:
|
if device_type in [101, 106, 107, 120]:
|
||||||
platforms.extend(PLATFORMS_SWITCH)
|
platforms.extend(PLATFORMS_SWITCH)
|
||||||
elif device_type in [102, 105]:
|
elif device_type in [102, 105]:
|
||||||
platforms.extend(PLATFORMS_BULB)
|
platforms.extend(PLATFORMS_BULB)
|
||||||
|
@ -68,7 +68,7 @@ async def test_init_switch_and_unload(
|
|||||||
(110, "sensor", ConfigEntryState.SETUP_ERROR, True),
|
(110, "sensor", ConfigEntryState.SETUP_ERROR, True),
|
||||||
(113, "switch", ConfigEntryState.SETUP_ERROR, True),
|
(113, "switch", ConfigEntryState.SETUP_ERROR, True),
|
||||||
(118, "button", 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(
|
async def test_init_bulb(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user