Functions | |
| str | _get_location_from_attributes (State entity_state) |
| State|None | closest (float latitude, float longitude, Iterable[State] states) |
| str|None | find_coordinates (HomeAssistant hass, str name, list|None recursion_history=None) |
| bool | has_location (State state) |
| str|None | resolve_zone (HomeAssistant hass, str zone_name) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
Location helpers for Home Assistant.
|
private |
Get the lat/long string from an entities attributes.
Definition at line 124 of file location.py.
| State | None homeassistant.helpers.location.closest | ( | float | latitude, |
| float | longitude, | ||
| Iterable[State] | states | ||
| ) |
Return closest state to point. Async friendly.
Definition at line 27 of file location.py.
| str | None homeassistant.helpers.location.find_coordinates | ( | HomeAssistant | hass, |
| str | name, | ||
| list | None | recursion_history = None |
||
| ) |
Try to resolve the a location from a supplied name or entity_id. Will recursively resolve an entity if pointed to by the state of the supplied entity. Returns coordinates in the form of '90.000,180.000', an address or the state of the last resolved entity.
Definition at line 49 of file location.py.
| bool homeassistant.helpers.location.has_location | ( | State | state | ) |
Test if state contains a valid location. Async friendly.
Definition at line 15 of file location.py.
| str | None homeassistant.helpers.location.resolve_zone | ( | HomeAssistant | hass, |
| str | zone_name | ||
| ) |
Get a lat/long from a zones friendly_name. None is returned if no zone is found by that friendly_name.
Definition at line 111 of file location.py.
|
private |
Definition at line 12 of file location.py.