Allow disabling entities in the registry (#12360)
This commit is contained in:
1 parent
a4b88fc31b
commit
d2cea84254
4 files changed
+64
-6
No files matched your search
@@ -216,6 +216,14 @@ class EntityPlatform(object):
|
||||
entry = registry.async_get_or_create(
|
||||
self.domain, self.platform_name, entity.unique_id,
|
||||
suggested_object_id=suggested_object_id)
|
||||
|
||||
if entry.disabled:
|
||||
self.logger.info(
|
||||
"Not adding entity %s because it's disabled",
|
||||
entry.name or entity.name or
|
||||
'"{} {}"'.format(self.platform_name, entity.unique_id))
|
||||
return
|
||||
|
||||
entity.entity_id = entry.entity_id
|
||||
entity.registry_name = entry.name
|
||||
|
||||
|
||||
Reference in new issue
Block a user