Remove hide_entity property from automation integration (#32038)

* Remove hidden property from automation integration

* Allow configuration options untils 0.110
This commit is contained in:
Franck Nijhof 2020-02-25 20:21:05 +01:00 committed by GitHub
parent 536b31305a
commit ceb3985a99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,6 @@ CONDITION_TYPE_AND = "and"
CONDITION_TYPE_OR = "or"
DEFAULT_CONDITION_TYPE = CONDITION_TYPE_AND
DEFAULT_HIDE_ENTITY = False
DEFAULT_INITIAL_STATE = True
ATTR_LAST_TRIGGERED = "last_triggered"
@ -92,7 +91,7 @@ _TRIGGER_SCHEMA = vol.All(
_CONDITION_SCHEMA = vol.All(cv.ensure_list, [cv.CONDITION_SCHEMA])
PLATFORM_SCHEMA = vol.All(
cv.deprecated(CONF_HIDE_ENTITY, invalidation_version="0.107"),
cv.deprecated(CONF_HIDE_ENTITY, invalidation_version="0.110"),
vol.Schema(
{
# str on purpose
@ -100,7 +99,7 @@ PLATFORM_SCHEMA = vol.All(
CONF_ALIAS: cv.string,
vol.Optional(CONF_DESCRIPTION): cv.string,
vol.Optional(CONF_INITIAL_STATE): cv.boolean,
vol.Optional(CONF_HIDE_ENTITY, default=DEFAULT_HIDE_ENTITY): cv.boolean,
vol.Optional(CONF_HIDE_ENTITY): cv.boolean,
vol.Required(CONF_TRIGGER): _TRIGGER_SCHEMA,
vol.Optional(CONF_CONDITION): _CONDITION_SCHEMA,
vol.Required(CONF_ACTION): cv.SCRIPT_SCHEMA,
@ -235,7 +234,6 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
trigger_config,
cond_func,
action_script,
hidden,
initial_state,
):
"""Initialize an automation entity."""
@ -246,7 +244,6 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
self._cond_func = cond_func
self.action_script = action_script
self._last_triggered = None
self._hidden = hidden
self._initial_state = initial_state
self._is_enabled = False
self._referenced_entities: Optional[Set[str]] = None
@ -272,11 +269,6 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
"""Return the entity state attributes."""
return {ATTR_LAST_TRIGGERED: self._last_triggered}
@property
def hidden(self) -> bool:
"""Return True if the automation entity should be hidden from UIs."""
return self._hidden
@property
def is_on(self) -> bool:
"""Return True if entity is on."""
@ -499,7 +491,6 @@ async def _async_process_config(hass, config, component):
automation_id = config_block.get(CONF_ID)
name = config_block.get(CONF_ALIAS) or f"{config_key} {list_no}"
hidden = config_block[CONF_HIDE_ENTITY]
initial_state = config_block.get(CONF_INITIAL_STATE)
action_script = script.Script(
@ -520,7 +511,6 @@ async def _async_process_config(hass, config, component):
config_block[CONF_TRIGGER],
cond_func,
action_script,
hidden,
initial_state,
)