mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Ensure flux_led is reloaded when the ICtype is changed (#64016)
This commit is contained in:
parent
128256a3ee
commit
7fc1306898
@ -137,6 +137,10 @@ class FluxICTypeSelect(FluxConfigSelect):
|
|||||||
async def async_select_option(self, option: str) -> None:
|
async def async_select_option(self, option: str) -> None:
|
||||||
"""Change the ic type."""
|
"""Change the ic type."""
|
||||||
await self._device.async_set_device_config(ic_type=option)
|
await self._device.async_set_device_config(ic_type=option)
|
||||||
|
# reload since we need to reinit the device
|
||||||
|
self.hass.async_create_task(
|
||||||
|
self.hass.config_entries.async_reload(self.coordinator.entry.entry_id)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class FluxWiringsSelect(FluxConfigSelect):
|
class FluxWiringsSelect(FluxConfigSelect):
|
||||||
|
@ -105,13 +105,19 @@ async def test_select_addressable_strip_config(hass: HomeAssistant) -> None:
|
|||||||
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "INVALID"},
|
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "INVALID"},
|
||||||
blocking=True,
|
blocking=True,
|
||||||
)
|
)
|
||||||
await hass.services.async_call(
|
|
||||||
SELECT_DOMAIN,
|
with patch(
|
||||||
"select_option",
|
"homeassistant.components.flux_led.async_setup_entry"
|
||||||
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "UCS1618"},
|
) as mock_setup_entry:
|
||||||
blocking=True,
|
await hass.services.async_call(
|
||||||
)
|
SELECT_DOMAIN,
|
||||||
|
"select_option",
|
||||||
|
{ATTR_ENTITY_ID: ic_type_entity_id, ATTR_OPTION: "UCS1618"},
|
||||||
|
blocking=True,
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
bulb.async_set_device_config.assert_called_once_with(ic_type="UCS1618")
|
bulb.async_set_device_config.assert_called_once_with(ic_type="UCS1618")
|
||||||
|
assert len(mock_setup_entry.mock_calls) == 1
|
||||||
|
|
||||||
|
|
||||||
async def test_select_mutable_0x25_strip_config(hass: HomeAssistant) -> None:
|
async def test_select_mutable_0x25_strip_config(hass: HomeAssistant) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user