Changed scene unique IDs (#22987)

There was a potential unique ID collission which caused problems for some users, as scenes and devices are enumerated separately, so the same ID could be assigned to in they are unnamed.
So I changed the unique ID generation for scenes to avoid this, which is a breaking change wrt scenes.
This commit is contained in:
pbalogh77 2019-04-17 18:56:34 +02:00 committed by Paulus Schoutsen
parent 7a9c9031af
commit 7d4083cdd3

View File

@ -220,9 +220,9 @@ class FibaroController():
room_name = self._room_map[device.roomID].name
device.room_name = room_name
device.friendly_name = '{} {}'.format(room_name, device.name)
device.ha_id = '{}_{}_{}'.format(
device.ha_id = 'scene_{}_{}_{}'.format(
slugify(room_name), slugify(device.name), device.id)
device.unique_id_str = "{}.{}".format(
device.unique_id_str = "{}.scene.{}".format(
self.hub_serial, device.id)
self._scene_map[device.id] = device
self.fibaro_devices['scene'].append(device)