Add unique_id to tellstick devices (#63391)

pull/63405/head
Michaël Arnauts 2022-01-04 21:16:43 +01:00 committed by GitHub
parent 919aa95f97
commit 5c8e802cbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 16 deletions

View File

@ -169,6 +169,9 @@ class TellstickDevice(Entity):
Contains the common logic for all Tellstick devices.
"""
_attr_assumed_state = True
_attr_should_poll = False
def __init__(self, tellcore_device, signal_repetitions):
"""Init the Tellstick device."""
self._signal_repetitions = signal_repetitions
@ -179,7 +182,8 @@ class TellstickDevice(Entity):
# Look up our corresponding 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):
"""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
def is_on(self):
"""Return true if the device is on."""