Skip to content

Commit 52bf737

Browse files
committed
2 parents ce9c262 + 6e6ece0 commit 52bf737

File tree

2 files changed

+91
-14
lines changed

2 files changed

+91
-14
lines changed
Lines changed: 78 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,107 @@
11
# Describes the format for available pyscript services
22

33
reload:
4-
description: Reload all available pyscripts and restart triggers
4+
name: Reload pyscript
5+
description: Reloads all available pyscripts and restart triggers
56
fields:
67
global_ctx:
7-
description: only reload this specific global context (file or app)
8+
name: Global Context
9+
description: Only reload this specific global context (file or app)
810
example: file.example
11+
required: false
12+
selector:
13+
text:
914

1015
jupyter_kernel_start:
11-
description: Start a jupyter kernel for interactive use; called by Jupyter front end
16+
name: Start Jupyter kernel
17+
description: Starts a jupyter kernel for interactive use; Called by Jupyter front end and should generally not be used by users
1218
fields:
1319
shell_port:
14-
description: shell port number
20+
name: Shell Port Number
21+
description: Shell port number
1522
example: 63599
23+
required: false
24+
selector:
25+
number:
26+
min: 10240
27+
max: 65535
1628
iopub_port:
17-
description: iopub port number
29+
name: IOPub Port Number
30+
description: IOPub port number
1831
example: 63598
32+
required: false
33+
selector:
34+
number:
35+
min: 10240
36+
max: 65535
1937
stdin_port:
20-
description: stdin port number
38+
name: Stdin Port Number
39+
description: Stdin port number
2140
example: 63597
41+
required: false
42+
selector:
43+
number:
44+
min: 10240
45+
max: 65535
2246
control_port:
23-
description: control port number
47+
name: Control Port Number
48+
description: Control port number
2449
example: 63596
50+
required: false
51+
selector:
52+
number:
53+
min: 10240
54+
max: 65535
2555
hb_port:
26-
description: heartbeat port number
56+
name: Heartbeat Port Number
57+
description: Heartbeat port number
2758
example: 63595
59+
required: false
60+
selector:
61+
number:
62+
min: 10240
63+
max: 65535
2864
ip:
29-
description: ip address to connect to jupyter front end
65+
name: IP Address
66+
description: IP address to connect to Jupyter front end
3067
example: 127.0.0.1
68+
default: 127.0.0.1
69+
required: false
70+
selector:
71+
text:
3172
key:
32-
description: security key for signing
73+
name: Security Key
74+
description: Used for signing
3375
example: 012345678-9abcdef023456789abcdef
76+
required: true
77+
selector:
78+
text:
3479
transport:
35-
description: type of transport
80+
name: Transport Type
81+
description: Transport type
3682
example: tcp
83+
default: tcp
84+
required: false
85+
selector:
86+
select:
87+
options:
88+
- tcp
89+
- udp
3790
signature_scheme:
38-
description: signing algorithm
91+
name: Signing Algorithm
92+
description: Signing algorithm
3993
example: hmac-sha256
94+
required: false
95+
default: hmac-sha256
96+
selector:
97+
select:
98+
options:
99+
- hmac-sha256
40100
kernel_name:
41-
description: name of kernel
101+
name: Name of Kernel
102+
description: Kernel name
42103
example: pyscript
104+
required: true
105+
default: pyscript
106+
selector:
107+
text:

docs/reference.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -941,21 +941,33 @@ description that appears is in the Services tab of the Developer Tools page. The
941941
names are used as the service parameter names, but there is no description.
942942

943943
Alternatively, 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:

0 commit comments

Comments
 (0)