mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 05:37:44 +00:00
better algorithm for computing unique_id (#22389)
This commit is contained in:
parent
71b800457b
commit
2b48ecd5c5
@ -7,7 +7,7 @@ from homeassistant.helpers.entity import ToggleEntity
|
||||
|
||||
from . import (
|
||||
CONF_ACTIVATION, CONF_MOMENTARY, CONF_PAUSE, CONF_REPEAT,
|
||||
DOMAIN as KONNECTED_DOMAIN, PIN_TO_ZONE, STATE_HIGH, STATE_LOW)
|
||||
DOMAIN as KONNECTED_DOMAIN, STATE_HIGH, STATE_LOW)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -41,7 +41,8 @@ class KonnectedSwitch(ToggleEntity):
|
||||
self._pause = self._data.get(CONF_PAUSE)
|
||||
self._repeat = self._data.get(CONF_REPEAT)
|
||||
self._state = self._boolean_state(self._data.get(ATTR_STATE))
|
||||
self._unique_id = '{}-{}'.format(device_id, PIN_TO_ZONE[pin_num])
|
||||
self._unique_id = '{}-{}'.format(device_id, hash(frozenset(
|
||||
{self._pin_num, self._momentary, self._pause, self._repeat})))
|
||||
self._name = self._data.get(CONF_NAME)
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user