mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Revert "Remove @bind_hass
from async_active_zone and make callback function" (#111704)
Revert "Remove `@bind_hass` from async_active_zone and make callback function…" This reverts commit f85a8c504184b4787ec8d488814914ed42b0d794.
This commit is contained in:
parent
259171eda9
commit
3ae056b358
@ -38,6 +38,7 @@ from homeassistant.helpers import (
|
|||||||
storage,
|
storage,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.typing import ConfigType, EventType
|
from homeassistant.helpers.typing import ConfigType, EventType
|
||||||
|
from homeassistant.loader import bind_hass
|
||||||
from homeassistant.util.location import distance
|
from homeassistant.util.location import distance
|
||||||
|
|
||||||
from .const import ATTR_PASSIVE, ATTR_RADIUS, CONF_PASSIVE, DOMAIN, HOME_ZONE
|
from .const import ATTR_PASSIVE, ATTR_RADIUS, CONF_PASSIVE, DOMAIN, HOME_ZONE
|
||||||
@ -62,6 +63,7 @@ CREATE_FIELDS = {
|
|||||||
vol.Optional(CONF_ICON): cv.icon,
|
vol.Optional(CONF_ICON): cv.icon,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UPDATE_FIELDS = {
|
UPDATE_FIELDS = {
|
||||||
vol.Optional(CONF_NAME): cv.string,
|
vol.Optional(CONF_NAME): cv.string,
|
||||||
vol.Optional(CONF_LATITUDE): cv.latitude,
|
vol.Optional(CONF_LATITUDE): cv.latitude,
|
||||||
@ -99,7 +101,7 @@ ENTITY_ID_SORTER = attrgetter("entity_id")
|
|||||||
ZONE_ENTITY_IDS = "zone_entity_ids"
|
ZONE_ENTITY_IDS = "zone_entity_ids"
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@bind_hass
|
||||||
def async_active_zone(
|
def async_active_zone(
|
||||||
hass: HomeAssistant, latitude: float, longitude: float, radius: int = 0
|
hass: HomeAssistant, latitude: float, longitude: float, radius: int = 0
|
||||||
) -> State | None:
|
) -> State | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user