Fix EntityComponent handle entities without a name (#8065)
* Fix EntityComponent handle entities without a name * Implement solution by Anders
This commit is contained in:
1 parent
2ba6b3a2ab
commit
18935440ed
2 files changed
+7
-5
No files matched your search
@@ -238,7 +238,8 @@ class EntityComponent(object):
|
||||
This method must be run in the event loop.
|
||||
"""
|
||||
if self.group_name is not None:
|
||||
ids = sorted(self.entities, key=lambda x: self.entities[x].name)
|
||||
ids = sorted(self.entities,
|
||||
key=lambda x: self.entities[x].name or x)
|
||||
group = get_component('group')
|
||||
group.async_set_group(
|
||||
self.hass, slugify(self.group_name), name=self.group_name,
|
||||
|
||||
Reference in new issue
Block a user