mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Move core services.yaml file to Home Assistant integration (#22489)
* Move services.yaml to correct dir * Remove special case for HA servicesgs
This commit is contained in:
parent
8e975395be
commit
95a7077b41
39
homeassistant/components/homeassistant/services.yaml
Normal file
39
homeassistant/components/homeassistant/services.yaml
Normal file
@ -0,0 +1,39 @@
|
||||
check_config:
|
||||
description: Check the Home Assistant configuration files for errors. Errors will be displayed in the Home Assistant log.
|
||||
|
||||
reload_core_config:
|
||||
description: Reload the core configuration.
|
||||
|
||||
restart:
|
||||
description: Restart the Home Assistant service.
|
||||
|
||||
stop:
|
||||
description: Stop the Home Assistant service.
|
||||
|
||||
toggle:
|
||||
description: Generic service to toggle devices on/off under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to toggle on/off.
|
||||
example: light.living_room
|
||||
|
||||
turn_on:
|
||||
description: Generic service to turn devices on under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to turn on.
|
||||
example: light.living_room
|
||||
|
||||
turn_off:
|
||||
description: Generic service to turn devices off under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to turn off.
|
||||
example: light.living_room
|
||||
|
||||
update_entity:
|
||||
description: Force one or more entities to update its data
|
||||
fields:
|
||||
entity_id:
|
||||
description: One or multiple entity_ids to update. Can be a list.
|
||||
example: light.living_room
|
@ -1,35 +0,0 @@
|
||||
# Describes the format for available component services
|
||||
|
||||
homeassistant:
|
||||
check_config:
|
||||
description: Check the Home Assistant configuration files for errors. Errors will be displayed in the Home Assistant log.
|
||||
reload_core_config:
|
||||
description: Reload the core configuration.
|
||||
restart:
|
||||
description: Restart the Home Assistant service.
|
||||
stop:
|
||||
description: Stop the Home Assistant service.
|
||||
toggle:
|
||||
description: Generic service to toggle devices on/off under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to toggle on/off.
|
||||
example: light.living_room
|
||||
turn_on:
|
||||
description: Generic service to turn devices on under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to turn on.
|
||||
example: light.living_room
|
||||
turn_off:
|
||||
description: Generic service to turn devices off under any domain. Same usage as the light.turn_on, switch.turn_on, etc. services.
|
||||
fields:
|
||||
entity_id:
|
||||
description: The entity_id of the device to turn off.
|
||||
example: light.living_room
|
||||
update_entity:
|
||||
description: Force one or more entities to update its data
|
||||
fields:
|
||||
entity_id:
|
||||
description: One or multiple entity_ids to update. Can be a list.
|
||||
example: light.living_room
|
@ -163,10 +163,6 @@ async def async_get_all_descriptions(hass):
|
||||
|
||||
def domain_yaml_file(domain):
|
||||
"""Return the services.yaml location for a domain."""
|
||||
if domain == ha.DOMAIN:
|
||||
from homeassistant import components
|
||||
component_path = path.dirname(components.__file__)
|
||||
else:
|
||||
component_path = path.dirname(get_component(hass, domain).__file__)
|
||||
return path.join(component_path, 'services.yaml')
|
||||
|
||||
@ -195,7 +191,6 @@ async def async_get_all_descriptions(hass):
|
||||
loaded = await hass.async_add_job(load_services_files, missing)
|
||||
|
||||
# Build response
|
||||
catch_all_yaml_file = domain_yaml_file(ha.DOMAIN)
|
||||
descriptions = {}
|
||||
for domain in services:
|
||||
descriptions[domain] = {}
|
||||
@ -207,9 +202,6 @@ async def async_get_all_descriptions(hass):
|
||||
|
||||
# Cache missing descriptions
|
||||
if description is None:
|
||||
if yaml_file == catch_all_yaml_file:
|
||||
yaml_services = loaded[yaml_file].get(domain, {})
|
||||
else:
|
||||
yaml_services = loaded[yaml_file]
|
||||
yaml_description = yaml_services.get(service, {})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user