mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Geo Location -> Geolocation (comments and default group name) (#19865)
* fixed geolocation naming in comments * fixed geolocation naming in default group name * fixed link to documentation (after https://github.com/home-assistant/home-assistant.io/pull/8086)
This commit is contained in:
parent
c7a32e59b7
commit
4bbfc04f5e
@ -1,9 +1,9 @@
|
|||||||
"""
|
"""
|
||||||
Offer geo location automation rules.
|
Offer geolocation automation rules.
|
||||||
|
|
||||||
For more details about this automation trigger, please refer to the
|
For more details about this automation trigger, please refer to the
|
||||||
documentation at
|
documentation at
|
||||||
https://home-assistant.io/docs/automation/trigger/#geo-location-trigger
|
https://home-assistant.io/docs/automation/trigger/#geolocation-trigger
|
||||||
"""
|
"""
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Geo Location component.
|
Geolocation component.
|
||||||
|
|
||||||
For more details about this component, please refer to the documentation at
|
For more details about this component, please refer to the documentation at
|
||||||
https://home-assistant.io/components/geo_location/
|
https://home-assistant.io/components/geo_location/
|
||||||
@ -22,13 +22,13 @@ DOMAIN = 'geo_location'
|
|||||||
|
|
||||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||||
|
|
||||||
GROUP_NAME_ALL_EVENTS = 'All Geo Location Events'
|
GROUP_NAME_ALL_EVENTS = 'All Geolocation Events'
|
||||||
|
|
||||||
SCAN_INTERVAL = timedelta(seconds=60)
|
SCAN_INTERVAL = timedelta(seconds=60)
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass, config):
|
async def async_setup(hass, config):
|
||||||
"""Set up the Geo Location component."""
|
"""Set up the Geolocation component."""
|
||||||
component = EntityComponent(
|
component = EntityComponent(
|
||||||
_LOGGER, DOMAIN, hass, SCAN_INTERVAL, GROUP_NAME_ALL_EVENTS)
|
_LOGGER, DOMAIN, hass, SCAN_INTERVAL, GROUP_NAME_ALL_EVENTS)
|
||||||
await component.async_setup(config)
|
await component.async_setup(config)
|
||||||
@ -36,7 +36,7 @@ async def async_setup(hass, config):
|
|||||||
|
|
||||||
|
|
||||||
class GeoLocationEvent(Entity):
|
class GeoLocationEvent(Entity):
|
||||||
"""This represents an external event with an associated geo location."""
|
"""This represents an external event with an associated geolocation."""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state(self):
|
def state(self):
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
"""
|
"""
|
||||||
Demo platform for the geo location component.
|
Demo platform for the geolocation component.
|
||||||
|
|
||||||
For more details about this platform, please refer to the documentation
|
For more details about this platform, please refer to the documentation
|
||||||
https://home-assistant.io/components/demo/
|
https://home-assistant.io/components/demo/
|
||||||
@ -30,15 +30,15 @@ SOURCE = 'demo'
|
|||||||
|
|
||||||
|
|
||||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||||
"""Set up the Demo geo locations."""
|
"""Set up the Demo geolocations."""
|
||||||
DemoManager(hass, add_entities)
|
DemoManager(hass, add_entities)
|
||||||
|
|
||||||
|
|
||||||
class DemoManager:
|
class DemoManager:
|
||||||
"""Device manager for demo geo location events."""
|
"""Device manager for demo geolocation events."""
|
||||||
|
|
||||||
def __init__(self, hass, add_entities):
|
def __init__(self, hass, add_entities):
|
||||||
"""Initialise the demo geo location event manager."""
|
"""Initialise the demo geolocation event manager."""
|
||||||
self._hass = hass
|
self._hass = hass
|
||||||
self._add_entities = add_entities
|
self._add_entities = add_entities
|
||||||
self._managed_devices = []
|
self._managed_devices = []
|
||||||
@ -91,7 +91,7 @@ class DemoManager:
|
|||||||
|
|
||||||
|
|
||||||
class DemoGeoLocationEvent(GeoLocationEvent):
|
class DemoGeoLocationEvent(GeoLocationEvent):
|
||||||
"""This represents a demo geo location event."""
|
"""This represents a demo geolocation event."""
|
||||||
|
|
||||||
def __init__(self, name, distance, latitude, longitude,
|
def __init__(self, name, distance, latitude, longitude,
|
||||||
unit_of_measurement):
|
unit_of_measurement):
|
||||||
@ -114,7 +114,7 @@ class DemoGeoLocationEvent(GeoLocationEvent):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""No polling needed for a demo geo location event."""
|
"""No polling needed for a demo geolocation event."""
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user