Allow esphome entities to be disabled by default (#53898)

This commit is contained in:
Jesse Hills 2021-08-04 00:53:48 +12:00 committed by GitHub
parent 081b2d533b
commit 672a74fa37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 3 deletions

View File

@ -978,3 +978,8 @@ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
def should_poll(self) -> bool:
"""Disable polling."""
return False
@property
def entity_registry_enabled_default(self) -> bool:
"""Return if the entity should be enabled when first added to the entity registry."""
return not self._static_info.disabled_by_default

View File

@ -3,7 +3,7 @@
"name": "ESPHome",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/esphome",
"requirements": ["aioesphomeapi==6.0.1"],
"requirements": ["aioesphomeapi==6.1.0"],
"zeroconf": ["_esphomelib._tcp.local."],
"codeowners": ["@OttoWinter", "@jesserockz"],
"after_dependencies": ["zeroconf", "tag"],

View File

@ -164,7 +164,7 @@ aioeafm==0.1.2
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==6.0.1
aioesphomeapi==6.1.0
# homeassistant.components.flo
aioflo==0.4.1

View File

@ -103,7 +103,7 @@ aioeafm==0.1.2
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==6.0.1
aioesphomeapi==6.1.0
# homeassistant.components.flo
aioflo==0.4.1