Allow disabling entities in the registry (#12360)

This commit is contained in:
Paulus Schoutsen authored and Pascal Vizeli committed 2018-02-13 13:33:15 +01:00
1 parent a4b88fc31b
commit d2cea84254
4 files changed
+64 -6

No files matched your search

+8
View File
@@ -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