From 4b4a290f718ca05d06b64368d9feba7ac9385fb1 Mon Sep 17 00:00:00 2001 From: Daniel Shokouhi Date: Fri, 4 Oct 2019 01:37:30 -0700 Subject: [PATCH] WAQI add unique ID and availability (#27086) * WAQI add unique ID and availability * Review comments * Fix unique ID * Fix unique ID --- homeassistant/components/waqi/sensor.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homeassistant/components/waqi/sensor.py b/homeassistant/components/waqi/sensor.py index dbfe6de1a60b..9f3c3ffc13eb 100644 --- a/homeassistant/components/waqi/sensor.py +++ b/homeassistant/components/waqi/sensor.py @@ -128,6 +128,16 @@ class WaqiSensor(Entity): return self._data.get("aqi") return None + @property + def available(self): + """Return sensor availability.""" + return self._data is not None + + @property + def unique_id(self): + """Return unique ID.""" + return self.uid + @property def unit_of_measurement(self): """Return the unit of measurement of this entity, if any."""