Skip to content

Commit

Permalink
Merge pull request #17 from pippyn/master
Browse files Browse the repository at this point in the history
Update sensor.py
  • Loading branch information
iantrich authored Jan 25, 2021
2 parents 2325f23 + 348fa33 commit 571ee79
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions custom_components/places/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down

0 comments on commit 571ee79

Please sign in to comment.