diff --git a/README.md b/README.md index 68d697ea..f4538b5f 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ Key | Type | Required | Description | Default | `api_key` | `string` | `False` | OpenStreetMap API key (your email address). | `no key` `map_provider` | `string` | `False` | `google` or `apple` | `apple` `map_zoom` | `number` | `False` | Level of zoom for the generated map link <1-20> | `18` -`options` | `string` | `False` | Display options: `zone, place, street_number, street, city, county, state, postal_code, country, formatted_address` | `zone, place` +`options` | `string` | `False` | Display options: `zone, place, street_number, street, city, county, state, postal_code, country, formatted_address, do_not_show_not_home` | `zone, place` Sample attributes that can be used in notifications, alerts, automations, etc: ```json diff --git a/custom_components/places/sensor.py b/custom_components/places/sensor.py index 1e339765..178fc261 100644 --- a/custom_components/places/sensor.py +++ b/custom_components/places/sensor.py @@ -638,9 +638,9 @@ def do_update(self, reason): new_state = osm_decoded['error_message'] _LOGGER.info( "(" + self._name + ") An error occurred contacting the web service") elif self._devicetracker_zone == "not_home": - if city == '': + if city == '-': city = postal_town - if city == '': + if city == '-': city = county # Options: "zone, place, street_number, street, city, county, state, postal_code, country, formatted_address" @@ -654,7 +654,7 @@ def do_update(self, reason): user_display = [] - if "zone" in display_options: + if "zone" in display_options and ("do_not_show_not_home" not in display_options and self._devicetracker_zone != "not_home"): zone = self._devicetracker_zone user_display.append(zone) if "place" in display_options: