Skip to content

Commit

Permalink
Merge pull request #224 from Snuffy2/Always-update-when-state-is-unknown
Browse files Browse the repository at this point in the history
Rework warnings. Update if previously unknown. Device Tracker to Tracked Entity.
  • Loading branch information
Snuffy2 authored Sep 17, 2023
2 parents 68c37ae + 78e6bdf commit 316067d
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 134 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/custom-components/places/hacs_validate.yml?branch=master&style=for-the-badge)](#places)<br/>
[![Community Forum](https://img.shields.io/badge/community-forum-orange.svg?label=HA%20Community&style=for-the-badge)](https://community.home-assistant.io/t/reverse-geocode-sensor-places-using-openstreetmap-custom-component)

_Component to integrate with OpenStreetMap Reverse Geocode and create a sensor with numerous address and place attributes from a device tracker, person, or sensor_
_Component to integrate with OpenStreetMap Reverse Geocode and create a sensor with numerous address and place attributes from a device_tracker, person, or sensor_

## Installation
### HACS *(recommended)*
Expand Down Expand Up @@ -66,7 +66,7 @@ custom_components/places/translations/en.json
Key | Required | Default | Description |
-- | -- | -- | --
`Sensor Name` | `Yes` | | Friendly name of the places sensor
`DeviceTracker ID` | `Yes` | | The location entity to track. **Must** have `latitude` and `longitude` as attributes. Suports these entities: `device_tracker`, `person`, `sensor`, `variable` & `zone`
`Tracked Entity ID` | `Yes` | | The location entity to track. **Must** have `latitude` and `longitude` as attributes. Supports these entities: `device_tracker`, `person`, `sensor`, `variable` & `zone`
`Email Address` | `No` | | OpenStreetMap API key (your email address).
`Display Options` | `No` | `zone_name`, `place` | Display options: `formatted_place` *(exclusive option)*, `driving` *(can be used with formatted_place or other options)*, `zone` or `zone_name`, `place`, `place_name`, `street_number`, `street`, `city`, `county`, `state`, `postal_code`, `country`, `formatted_address`, `do_not_show_not_home`<br /><br />**See optional Advanced Display Options below to use more complex display logic.**
`Home Zone` | `No` | `zone.home` | Used to calculate distance from home and direction of travel
Expand Down
6 changes: 3 additions & 3 deletions custom_components/places/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
def get_devicetracker_id_entities(
hass: core.HomeAssistant, current_entity=None
) -> list[str]:
"""Get the list of valid entities. For sensors, only include ones with latitude and longitude attributes. For the devicetracker selector"""
"""Get the list of valid entities. For sensors, only include ones with latitude and longitude attributes."""
dt_list = []
for dom in TRACKING_DOMAINS:
# _LOGGER.debug(f"Geting entities for domain: {dom}")
Expand Down Expand Up @@ -170,7 +170,7 @@ async def async_step_user(self, user_input=None) -> FlowResult:
errors["base"] = "unknown"
devicetracker_id_list = get_devicetracker_id_entities(self.hass)
zone_list = get_home_zone_entities(self.hass)
# _LOGGER.debug(f"Devicetracker entities with lat/long: {devicetracker_id_list}")
# _LOGGER.debug(f"Trackable entities with lat/long: {devicetracker_id_list}")
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_NAME): str,
Expand Down Expand Up @@ -288,7 +288,7 @@ async def async_step_init(self, user_input=None):
else None,
)
zone_list = get_home_zone_entities(self.hass)
# _LOGGER.debug(f"Devicetracker_id entities including sensors with lat/long: {devicetracker_id_list}")
# _LOGGER.debug(f"Trackable entities including sensors with lat/long: {devicetracker_id_list}")
OPTIONS_SCHEMA = vol.Schema(
{
vol.Required(
Expand Down
Loading

0 comments on commit 316067d

Please sign in to comment.