1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

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
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: