Fix konnected unique_id computation for switches (#22777)

pull/22196/head
Nate Clark 2019-04-05 18:22:57 -04:00 committed by Martin Hjelmare
parent d1bf470899
commit 144632a81b
1 changed files with 3 additions and 2 deletions

View File

@ -41,9 +41,10 @@ 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, hash(frozenset(
{self._pin_num, self._momentary, self._pause, self._repeat})))
self._name = self._data.get(CONF_NAME)
self._unique_id = '{}-{}-{}-{}-{}'.format(
device_id, self._pin_num, self._momentary,
self._pause, self._repeat)
@property
def unique_id(self) -> str: