mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
restore_state: do not crash if domain not defined (#6714)
This commit is contained in:
parent
8325f9db8a
commit
de231cf9ab
@ -142,7 +142,12 @@ def async_reproduce_state(hass, states, blocking=False):
|
|||||||
else:
|
else:
|
||||||
service_domain = state.domain
|
service_domain = state.domain
|
||||||
|
|
||||||
domain_services = hass.services.async_services()[service_domain]
|
domain_services = hass.services.async_services().get(service_domain)
|
||||||
|
|
||||||
|
if not domain_services:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"reproduce_state: Unable to reproduce state %s (1)", state)
|
||||||
|
continue
|
||||||
|
|
||||||
service = None
|
service = None
|
||||||
for _service in domain_services.keys():
|
for _service in domain_services.keys():
|
||||||
@ -157,8 +162,8 @@ def async_reproduce_state(hass, states, blocking=False):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if not service:
|
if not service:
|
||||||
_LOGGER.warning("reproduce_state: Unable to reproduce state %s",
|
_LOGGER.warning(
|
||||||
state)
|
"reproduce_state: Unable to reproduce state %s (2)", state)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# We group service calls for entities by service call
|
# We group service calls for entities by service call
|
||||||
|
Loading…
x
Reference in New Issue
Block a user