Skip to content

Commit

Permalink
Add available property to Ambient PWS (#22092)
Browse files Browse the repository at this point in the history
* Add available property to Ambient PWS

* Linting

* remove blank line
  • Loading branch information
bachya authored and Danielhiversen committed Mar 16, 2019
1 parent 9e4bd88 commit 7807b40
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions homeassistant/components/ambient_station/__init__.py
Expand Up @@ -411,6 +411,13 @@ def __init__(
self._state = None
self._station_name = station_name

@property
def available(self):
"""Return True if entity is available."""
return bool(
self._ambient.stations[self._mac_address][ATTR_LAST_DATA].get(
self._sensor_type))

@property
def device_info(self):
"""Return device registry information for this entity."""
Expand Down

0 comments on commit 7807b40

Please sign in to comment.