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:
1 parent
d89c56829c
commit
d1c8d39107
4 files changed
+24
No files matched your search
@@ -44,6 +44,7 @@ class AdsSwitch(ToggleEntity):
|
||||
self._ads_hub = ads_hub
|
||||
self._on_state = False
|
||||
self._name = name
|
||||
self._unique_id = ads_var
|
||||
self.ads_var = ads_var
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
@@ -68,6 +69,11 @@ class AdsSwitch(ToggleEntity):
|
||||
"""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 should_poll(self):
|
||||
"""Return False because entity pushes its state to HA."""
|
||||
|
||||
Reference in new issue
Block a user