File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -941,21 +941,33 @@ description that appears is in the Services tab of the Developer Tools page. The
941941names are used as the service parameter names, but there is no description.
942942
943943Alternatively, if the ``doc_string `` starts with ``yaml ``, the rest of the string is used as a
944- ``yaml `` service description. Here's the first example above, with a more detailed ``doc_string ``:
944+ ``yaml `` service description. Here's the first example above, with a more detailed ``doc_string ``
945+ (for a more complete example and explanation of the service description, check the Home Assistant
946+ `developer documentation <#https://developers.home-assistant.io/docs/dev_101_services#service-descriptions >`__):
945947
946948.. code :: python
947949
948950 @service
949951 def hello_world (action = None , id = None ):
950952 """ yaml
953+ name: Service example
951954 description: hello_world service example using pyscript.
952955 fields:
953956 action:
954957 description: turn_on turns on the light, fire fires an event
955958 example: turn_on
959+ required: true
960+ selector:
961+ select:
962+ options:
963+ - turn_on
964+ - fire
956965 id:
957966 description: id of light, or name of event to fire
958967 example: kitchen.light
968+ required: true
969+ selector:
970+ text:
959971 """
960972 log.info(f " hello world: got action { action} " )
961973 if action == " turn_on" and id is not None :
You can’t perform that action at this time.
0 commit comments