Fix script regression

This commit is contained in:
Paulus Schoutsen committed 2015-10-28 12:24:33 -07:00
1 parent 0a36c96a55
commit 12495c717e
3 files changed
+30 -11

No files matched your search

+4 -2
View File
@@ -65,8 +65,10 @@ class EntityComponent(object):
if entity is not None and entity not in self.entities.values():
entity.hass = self.hass
entity.entity_id = generate_entity_id(
self.entity_id_format, entity.name, self.entities.keys())
if getattr(entity, 'entity_id', None) is None:
entity.entity_id = generate_entity_id(
self.entity_id_format, entity.name,
self.entities.keys())
self.entities[entity.entity_id] = entity