Warn if state_changed events are excluded from recorder (#58021)

This commit is contained in:
Erik Montnemery 2021-10-22 14:25:36 +02:00 committed by GitHub
parent f25d3cf9b3
commit ab2ff45726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,6 +249,11 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
)
exclude = conf[CONF_EXCLUDE]
exclude_t = exclude.get(CONF_EVENT_TYPES, [])
if EVENT_STATE_CHANGED in exclude_t:
_LOGGER.warning(
"State change events are excluded, recorder will not record state changes."
"This will become an error in Home Assistant Core 2022.2"
)
instance = hass.data[DATA_INSTANCE] = Recorder(
hass=hass,
auto_purge=auto_purge,