mirror of
https://github.com/home-assistant/core.git
synced 2025-08-12 09:05:15 +02:00
Ignore Shelly block update with cfgChanged None (#113587)
This commit is contained in:
committed by
Paulus Schoutsen
parent
a7908d8250
commit
0a64ae2f7a
@@ -216,7 +216,7 @@ class ShellyBlockCoordinator(ShellyCoordinatorBase[BlockDevice]):
|
|||||||
# Check for input events and config change
|
# Check for input events and config change
|
||||||
cfg_changed = 0
|
cfg_changed = 0
|
||||||
for block in self.device.blocks:
|
for block in self.device.blocks:
|
||||||
if block.type == "device":
|
if block.type == "device" and block.cfgChanged is not None:
|
||||||
cfg_changed = block.cfgChanged
|
cfg_changed = block.cfgChanged
|
||||||
|
|
||||||
# Shelly TRV sends information about changing the configuration for no
|
# Shelly TRV sends information about changing the configuration for no
|
||||||
|
@@ -67,6 +67,18 @@ async def test_block_reload_on_cfg_change(
|
|||||||
mock_block_device.mock_update()
|
mock_block_device.mock_update()
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
# Make sure cfgChanged with None is ignored
|
||||||
|
monkeypatch.setattr(mock_block_device.blocks[DEVICE_BLOCK_ID], "cfgChanged", None)
|
||||||
|
mock_block_device.mock_update()
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
# Wait for debouncer
|
||||||
|
freezer.tick(timedelta(seconds=ENTRY_RELOAD_COOLDOWN))
|
||||||
|
async_fire_time_changed(hass)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
assert hass.states.get("switch.test_name_channel_1") is not None
|
||||||
|
|
||||||
# Generate config change from switch to light
|
# Generate config change from switch to light
|
||||||
monkeypatch.setitem(
|
monkeypatch.setitem(
|
||||||
mock_block_device.settings["relays"][RELAY_BLOCK_ID], "appliance_type", "light"
|
mock_block_device.settings["relays"][RELAY_BLOCK_ID], "appliance_type", "light"
|
||||||
|
Reference in New Issue
Block a user