Skip to content

Commit 86ee654

Browse files
authored
No more nested objects in the GroupedLightPut payloads (#30)
1 parent 64af0ac commit 86ee654

File tree

10 files changed

+54
-110
lines changed

10 files changed

+54
-110
lines changed

src/common/Alert.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: object
2+
description: Joined alert control
3+
properties:
4+
action:
5+
type: string
6+
example: breathe
File renamed without changes.

src/common/Dynamics.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
type: object
2+
properties:
3+
duration:
4+
type: integer
5+
minimum: 0
6+
description: Duration of a light transition or timed effects in ms.

src/common/Signaling.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
type: object
2+
description: Feature containing basic signaling properties.
3+
properties:
4+
signal:
5+
type: string
6+
description: |
7+
- `no_signal`: No signal is active. Write “no_signal” to stop active signal.
8+
- `on_off`: Toggles between max brightness and Off in fixed color.
9+
- `on_off_color`: Toggles between off and max brightness with color provided.
10+
- `alternating`: Alternates between 2 provided colors.
11+
enum:
12+
- no_signal
13+
- on_off
14+
- on_off_color
15+
- alternating
16+
duration:
17+
type: integer
18+
minimum: 0
19+
maximum: 65534000
20+
description: |
21+
Duration has a max of 65534000 ms and a stepsize of 1 second.
22+
Values inbetween steps will be rounded.
23+
Duration is ignored for `no_signal`.
24+
color:
25+
type: array
26+
minItems: 1
27+
maxItems: 2
28+
description: List of colors to apply to the signal (not supported by all signals)
29+
items:
30+
$ref: './Color.yaml'

src/grouped_light/schemas/GroupedLightPut.yaml

Lines changed: 6 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -10,83 +10,16 @@ properties:
1010
dimming:
1111
$ref: '../../common/Dimming.yaml'
1212
dimming_delta:
13-
type: object
14-
required:
15-
- action
16-
properties:
17-
action:
18-
type: string
19-
enum:
20-
- up
21-
- down
22-
- stop
23-
brightness_delta:
24-
type: number
25-
minimum: 0
26-
maximum: 100
27-
description: Brightness percentage of full-scale increase delta to current dimlevel. Clip at Max-level or Min-level.
13+
$ref: '../../common//DimmingDelta.yaml'
2814
color_temperature:
29-
type: object
30-
description: Joined color temperature control
31-
properties:
32-
mirek:
33-
$ref: '../../common/Mirek.yaml'
15+
$ref: '../../common/ColorTemperature.yaml'
3416
color_temperature_delta:
35-
type: object
36-
required:
37-
- action
38-
properties:
39-
action:
40-
type: string
41-
enum:
42-
- up
43-
- down
44-
- stop
45-
mirek_delta:
46-
$ref: '../../common/Mirek.yaml'
47-
description: Mirek delta to current mirek. Clip at mirek_minimum and mirek_maximum of mirek_schema.
17+
$ref: '../../common/ColorTemperatureDelta.yaml'
4818
color:
4919
$ref: '../../common/Color.yaml'
5020
alert:
51-
type: object
52-
description: Joined alert control
53-
properties:
54-
action:
55-
type: string
56-
example: breathe
21+
$ref: '../../common/Alert.yaml'
5722
signaling:
58-
type: object
59-
description: Feature containing basic signaling properties.
60-
properties:
61-
signal:
62-
type: string
63-
description: |
64-
- `no_signal`: No signal is active. Write “no_signal” to stop active signal.
65-
- `on_off`: Toggles between max brightness and Off in fixed color.
66-
- `on_off_color`: Toggles between off and max brightness with color provided.
67-
- `alternating`: Alternates between 2 provided colors.
68-
enum:
69-
- no_signal
70-
- on_off
71-
- on_off_color
72-
- alternating
73-
duration:
74-
type: integer
75-
minimum: 0
76-
maximum: 65534000
77-
description: |
78-
Duration has a max of 65534000 ms and a stepsize of 1 second.
79-
Values inbetween steps will be rounded.
80-
Duration is ignored for `no_signal`.
81-
color:
82-
type: array
83-
description: List of colors to apply to the signal (not supported by all signals)
84-
items:
85-
$ref: '../../common/Color.yaml'
23+
$ref: '../../common/Signaling.yaml'
8624
dynamics:
87-
type: object
88-
properties:
89-
duration:
90-
type: integer
91-
minimum: 0
92-
description: Duration of a light transition or timed effects in ms.
25+
$ref: '../../common/Dynamics.yaml'

src/light/schemas/Color.yaml

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/light/schemas/LightPut.yaml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,19 @@ properties:
88
dimming:
99
$ref: '../../common/Dimming.yaml'
1010
dimming_delta:
11-
$ref: './DimmingDelta.yaml'
11+
$ref: '../../common//DimmingDelta.yaml'
1212
color_temperature:
1313
$ref: '../../common/ColorTemperature.yaml'
1414
color_temperature_delta:
15-
$ref: './ColorTemperatureDelta.yaml'
15+
$ref: '../../common/ColorTemperatureDelta.yaml'
1616
color:
17-
$ref: './Color.yaml'
17+
$ref: '../../common/Color.yaml'
1818
dynamics:
1919
$ref: './Dynamics.yaml'
2020
alert:
21-
type: object
22-
properties:
23-
action:
24-
type: string
21+
$ref: '../../common/Alert.yaml'
2522
signaling:
26-
$ref: './Signaling.yaml'
23+
$ref: '../../common/Signaling.yaml'
2724
mode:
2825
type: string
2926
enum:

src/light/schemas/Signaling.yaml

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/scene/schemas/ActionPost.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,4 @@ properties:
3131
effect:
3232
$ref: '../../common/SupportedEffects.yaml'
3333
dynamics:
34-
type: object
35-
properties:
36-
duration:
37-
type: integer
38-
description: Duration of a light transition or timed effects in ms.
34+
$ref: '../../common/Dynamics.yaml'

0 commit comments

Comments
 (0)