1
mirror of https://github.com/home-assistant/core synced 2024-08-28 03:36:46 +02:00
ha-core/homeassistant/components/person/significant_change.py
2021-03-18 13:21:46 +01:00

24 lines
479 B
Python

"""Helper to test significant Person state changes."""
from __future__ import annotations
from typing import Any
from homeassistant.core import HomeAssistant, callback
@callback
def async_check_significant_change(
hass: HomeAssistant,
old_state: str,
old_attrs: dict,
new_state: str,
new_attrs: dict,
**kwargs: Any,
) -> bool | None:
"""Test if state significantly changed."""
if new_state != old_state:
return True
return False