Restore states through a JSON store instead of recorder (#17270)
* Restore states through a JSON store * Accept entity_id directly in restore state helper * Keep states stored between runs for a limited time * Remove warning
This commit is contained in:
parent
a039c3209b
commit
5c3a4e3d10
46 changed files with 493 additions and 422 deletions
|
@ -57,7 +57,8 @@ async def test_sending_mqtt_commands_and_optimistic(hass, mock_publish):
|
|||
"""Test the sending MQTT commands in optimistic mode."""
|
||||
fake_state = ha.State('switch.test', 'on')
|
||||
|
||||
with patch('homeassistant.components.switch.mqtt.async_get_last_state',
|
||||
with patch('homeassistant.helpers.restore_state.RestoreEntity'
|
||||
'.async_get_last_state',
|
||||
return_value=mock_coro(fake_state)):
|
||||
assert await async_setup_component(hass, switch.DOMAIN, {
|
||||
switch.DOMAIN: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue