WAQI add unique ID and availability (#27086)
* WAQI add unique ID and availability * Review comments * Fix unique ID * Fix unique ID
This commit is contained in:
parent
98eaecf61d
commit
4b4a290f71
1 changed files with 10 additions and 0 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Reference in a new issue