Fix konnected unique_id computation for switches (#22777)

This commit is contained in:
Nate Clark 2019-04-05 18:22:57 -04:00 committed by Paulus Schoutsen
parent a44966f483
commit dbe53a3947

View File

@ -41,9 +41,10 @@ class KonnectedSwitch(ToggleEntity):
self._pause = self._data.get(CONF_PAUSE) self._pause = self._data.get(CONF_PAUSE)
self._repeat = self._data.get(CONF_REPEAT) self._repeat = self._data.get(CONF_REPEAT)
self._state = self._boolean_state(self._data.get(ATTR_STATE)) self._state = self._boolean_state(self._data.get(ATTR_STATE))
self._unique_id = '{}-{}'.format(device_id, hash(frozenset(
{self._pin_num, self._momentary, self._pause, self._repeat})))
self._name = self._data.get(CONF_NAME) self._name = self._data.get(CONF_NAME)
self._unique_id = '{}-{}-{}-{}-{}'.format(
device_id, self._pin_num, self._momentary,
self._pause, self._repeat)
@property @property
def unique_id(self) -> str: def unique_id(self) -> str: