core/homeassistant/components/person/significant_change.py

22 lines
456 B
Python
Raw Normal View History

"""Helper to test significant Person state changes."""
from typing import Any, Optional
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,
) -> Optional[bool]:
"""Test if state significantly changed."""
if new_state != old_state:
return True
return False