mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Add unique_id to tellstick devices (#63391)
This commit is contained in:
parent
919aa95f97
commit
5c8e802cbf
@ -169,6 +169,9 @@ class TellstickDevice(Entity):
|
|||||||
Contains the common logic for all Tellstick devices.
|
Contains the common logic for all Tellstick devices.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
_attr_assumed_state = True
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, tellcore_device, signal_repetitions):
|
def __init__(self, tellcore_device, signal_repetitions):
|
||||||
"""Init the Tellstick device."""
|
"""Init the Tellstick device."""
|
||||||
self._signal_repetitions = signal_repetitions
|
self._signal_repetitions = signal_repetitions
|
||||||
@ -179,7 +182,8 @@ class TellstickDevice(Entity):
|
|||||||
|
|
||||||
# Look up our corresponding tellcore device
|
# Look up our corresponding tellcore device
|
||||||
self._tellcore_device = tellcore_device
|
self._tellcore_device = tellcore_device
|
||||||
self._name = tellcore_device.name
|
self._attr_name = tellcore_device.name
|
||||||
|
self._attr_unique_id = tellcore_device.id
|
||||||
|
|
||||||
async def async_added_to_hass(self):
|
async def async_added_to_hass(self):
|
||||||
"""Register callbacks."""
|
"""Register callbacks."""
|
||||||
@ -189,21 +193,6 @@ class TellstickDevice(Entity):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Tell Home Assistant not to poll this device."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
|
||||||
def assumed_state(self):
|
|
||||||
"""Tellstick devices are always assumed state."""
|
|
||||||
return True
|
|
||||||
|
|
||||||
@property
|
|
||||||
def name(self):
|
|
||||||
"""Return the name of the device as reported by tellcore."""
|
|
||||||
return self._name
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if the device is on."""
|
"""Return true if the device is on."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user