1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Add unique id to ADS platforms (#20511)

* Add friendly_name option

* Correct hound findings

* correct hound findings 2

* add unique id

* add unique id to all ads platforms
This commit is contained in:
carstenschroeder
2019-02-12 18:42:09 +01:00
committed by Martin Hjelmare
parent d89c56829c
commit d1c8d39107
4 changed files with 24 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ class AdsSensor(Entity):
"""Initialize AdsSensor entity."""
self._ads_hub = ads_hub
self._name = name
self._unique_id = ads_var
self._value = None
self._unit_of_measurement = unit_of_measurement
self.ads_var = ads_var
@@ -84,6 +85,11 @@ class AdsSensor(Entity):
"""Return the name of the entity."""
return self._name
@property
def unique_id(self):
"""Return an unique identifier for this entity."""
return self._unique_id
@property
def state(self):
"""Return the state of the device."""