Add available property to Ambient PWS (#22092)

* Add available property to Ambient PWS

* Linting

* remove blank line
This commit is contained in:
Aaron Bach 2019-03-16 04:33:22 -06:00 committed by Daniel Høyer Iversen
parent 9e4bd88a06
commit 7807b40925

View File

@ -411,6 +411,13 @@ class AmbientWeatherEntity(Entity):
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."""