def _get_state(hass: HomeAssistant, entity_id: str) -> (TemplateState | None):
    return _get_template_state_from_state(hass, entity_id, hass.states.get(entity_id))
def _get_state(hass: HomeAssistant, entity_id: str) -> (TemplateState | None):
    return _get_template_state_from_state(hass, entity_id, hass.states.get(entity_id))