Make use of generic EntityComponent (#78492)
This commit is contained in:
parent
19ea95a6e4
commit
b4afb1cb6b
7 changed files with 32 additions and 45 deletions
|
@ -86,7 +86,7 @@ def _scripts_with_x(
|
|||
if DOMAIN not in hass.data:
|
||||
return []
|
||||
|
||||
component = hass.data[DOMAIN]
|
||||
component: EntityComponent[ScriptEntity] = hass.data[DOMAIN]
|
||||
|
||||
return [
|
||||
script_entity.entity_id
|
||||
|
@ -100,7 +100,7 @@ def _x_in_script(hass: HomeAssistant, entity_id: str, property_name: str) -> lis
|
|||
if DOMAIN not in hass.data:
|
||||
return []
|
||||
|
||||
component = hass.data[DOMAIN]
|
||||
component: EntityComponent[ScriptEntity] = hass.data[DOMAIN]
|
||||
|
||||
if (script_entity := component.get_entity(entity_id)) is None:
|
||||
return []
|
||||
|
@ -150,7 +150,7 @@ def scripts_with_blueprint(hass: HomeAssistant, blueprint_path: str) -> list[str
|
|||
if DOMAIN not in hass.data:
|
||||
return []
|
||||
|
||||
component = hass.data[DOMAIN]
|
||||
component: EntityComponent[ScriptEntity] = hass.data[DOMAIN]
|
||||
|
||||
return [
|
||||
script_entity.entity_id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue