We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b3a8c6e commit b023023Copy full SHA for b023023
docs/source/tutorial/writing_a_thing.rst
@@ -16,11 +16,17 @@ Our first Thing will pretend to be a light: we can set its brightness and turn i
16
import labthings_fastapi as lt
17
18
class Light(lt.Thing):
19
+ """A computer-controlled light, our first example Thing."""
20
+
21
brightness: int = lt.property(default=100)
22
+ """The brightness of the light, in % of maximum."""
23
24
is_on: bool = lt.property(default=False, readonly=true)
25
+ """Whether the light is currently on."""
26
27
@lt.action
28
def toggle(self):
29
+ """Swap the light between on and off."""
30
self.is_on = not self.is_on
31
32
0 commit comments