Allow entities to indicate they should be disabled by default (#26011)

This commit is contained in:
Paulus Schoutsen 2019-08-16 16:17:16 -07:00 committed by GitHub
parent b5893a8a6e
commit 6c292846be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 55 additions and 1 deletions

View file

@ -908,6 +908,11 @@ class MockEntity(entity.Entity):
"""Info how it links to a device."""
return self._handle("device_info")
@property
def entity_registry_enabled_default(self):
"""Return if the entity should be enabled when first added to the entity registry."""
return self._handle("entity_registry_enabled_default")
def _handle(self, attr):
"""Return attribute value."""
if attr in self._values: