Skip to content

Commit 64af0ac

Browse files
authored
No more nested objects in the ScenePut and ScenePost payloads (#29)
1 parent fe86f43 commit 64af0ac

File tree

6 files changed

+65
-156
lines changed

6 files changed

+65
-156
lines changed

src/scene/schemas/SceneGet.yaml

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -13,54 +13,11 @@ allOf:
1313
items:
1414
$ref: './ActionGet.yaml'
1515
metadata:
16-
type: object
17-
properties:
18-
name:
19-
type: string
20-
minLength: 1
21-
maxLength: 32
22-
description: Human readable name of a resource
23-
image:
24-
# description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
25-
$ref: '../../common/ResourceIdentifier.yaml'
26-
appdata:
27-
type: string
28-
minLength: 1
29-
maxLength: 16
30-
description: Application specific data. Free format string.
16+
$ref: './SceneMetadata.yaml'
3117
group:
3218
$ref: '../../common/ResourceIdentifier.yaml'
3319
palette:
34-
type: object
35-
description: Group of colors that describe the palette of colors to be used when playing dynamics
36-
properties:
37-
color:
38-
type: array
39-
minItems: 0
40-
maxItems: 9
41-
items:
42-
$ref: './ColorPaletteGet.yaml'
43-
dimming:
44-
type: array
45-
minItems: 0
46-
maxItems: 1
47-
items:
48-
$ref: '../../common/Dimming.yaml'
49-
color_temperature:
50-
type: array
51-
minItems: 0
52-
maxItems: 1
53-
items:
54-
$ref: './ColorTemperaturePaletteGet.yaml'
55-
effects:
56-
type: array
57-
minItems: 0
58-
maxItems: 3
59-
items:
60-
type: object
61-
properties:
62-
effect:
63-
$ref: '../../common/SupportedEffects.yaml'
20+
$ref: './ScenePalette.yaml'
6421
speed:
6522
type: number
6623
minimum: 0
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type: object
2+
properties:
3+
name:
4+
type: string
5+
minLength: 1
6+
maxLength: 32
7+
description: Human readable name of a resource
8+
image:
9+
$ref: '../../common/ResourceIdentifier.yaml'
10+
appdata:
11+
type: string
12+
minLength: 1
13+
maxLength: 16
14+
description: Application specific data. Free format string.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
type: object
2+
description: Group of colors that describe the palette of colors to be used when playing dynamics
3+
properties:
4+
color:
5+
type: array
6+
minItems: 0
7+
maxItems: 9
8+
items:
9+
$ref: './ColorPaletteGet.yaml'
10+
dimming:
11+
type: array
12+
minItems: 0
13+
maxItems: 1
14+
items:
15+
$ref: '../../common/Dimming.yaml'
16+
color_temperature:
17+
type: array
18+
minItems: 0
19+
maxItems: 1
20+
items:
21+
$ref: './ColorTemperaturePalettePost.yaml'
22+
effects:
23+
type: array
24+
minItems: 0
25+
maxItems: 3
26+
items:
27+
type: object
28+
properties:
29+
effect:
30+
$ref: '../../common/SupportedEffects.yaml'

src/scene/schemas/ScenePost.yaml

Lines changed: 2 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -14,57 +14,11 @@ properties:
1414
items:
1515
$ref: './ActionPost.yaml'
1616
metadata:
17-
type: object
18-
properties:
19-
name:
20-
type: string
21-
minLength: 1
22-
maxLength: 32
23-
description: Human readable name of a resource
24-
image:
25-
description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
26-
$ref: '../../common/ResourceIdentifier.yaml'
27-
appdata:
28-
type: string
29-
minLength: 1
30-
maxLength: 16
31-
description: Application specific data. Free format string.
17+
$ref: './SceneMetadata.yaml'
3218
group:
33-
description: |
34-
Group associated with this Scene. All services in the group are part of this scene.
35-
If the group is changed the scene is update (e.g. light added/removed)
3619
$ref: '../../common/ResourceIdentifier.yaml'
3720
palette:
38-
type: object
39-
description: Group of colors that describe the palette of colors to be used when playing dynamics
40-
properties:
41-
color:
42-
type: array
43-
minItems: 0
44-
maxItems: 9
45-
items:
46-
$ref: './ColorPaletteGet.yaml'
47-
dimming:
48-
type: array
49-
minItems: 0
50-
maxItems: 1
51-
items:
52-
$ref: '../../common/Dimming.yaml'
53-
color_temperature:
54-
type: array
55-
minItems: 0
56-
maxItems: 1
57-
items:
58-
$ref: './ColorTemperaturePalettePost.yaml'
59-
effects:
60-
type: array
61-
minItems: 0
62-
maxItems: 3
63-
items:
64-
type: object
65-
properties:
66-
effect:
67-
$ref: '../../common/SupportedEffects.yaml'
21+
$ref: './ScenePalette.yaml'
6822
speed:
6923
type: number
7024
minimum: 0

src/scene/schemas/ScenePut.yaml

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
type: object
2-
required:
3-
- actions
4-
- metadata
5-
- group
62
properties:
73
type:
84
type: string
@@ -14,67 +10,11 @@ properties:
1410
items:
1511
$ref: './ActionPost.yaml'
1612
recall:
17-
type: object
18-
properties:
19-
action:
20-
type: string
21-
description: When writing active, the actions in the scene are executed on the target. dynamic_palette starts dynamic scene with colors in the Palette object.
22-
enum:
23-
- active
24-
- dynamic_palette
25-
- static
26-
duration:
27-
type: integer
28-
description: Transition to the scene within the timeframe given by duration
29-
dimming:
30-
$ref: '../../common/Dimming.yaml'
13+
$ref: './SceneRecall.yaml'
3114
metadata:
32-
type: object
33-
properties:
34-
name:
35-
type: string
36-
minLength: 1
37-
maxLength: 32
38-
description: Human readable name of a resource
39-
image:
40-
description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
41-
$ref: '../../common/ResourceIdentifier.yaml'
42-
appdata:
43-
type: string
44-
minLength: 1
45-
maxLength: 16
46-
description: Application specific data. Free format string.
15+
$ref: './SceneMetadata.yaml'
4716
palette:
48-
type: object
49-
description: Group of colors that describe the palette of colors to be used when playing dynamics
50-
properties:
51-
color:
52-
type: array
53-
minItems: 0
54-
maxItems: 9
55-
items:
56-
$ref: './ColorPaletteGet.yaml'
57-
dimming:
58-
type: array
59-
minItems: 0
60-
maxItems: 1
61-
items:
62-
$ref: '../../common/Dimming.yaml'
63-
color_temperature:
64-
type: array
65-
minItems: 0
66-
maxItems: 1
67-
items:
68-
$ref: './ColorTemperaturePalettePost.yaml'
69-
effects:
70-
type: array
71-
minItems: 0
72-
maxItems: 3
73-
items:
74-
type: object
75-
properties:
76-
effect:
77-
$ref: '../../common/SupportedEffects.yaml'
17+
$ref: './ScenePalette.yaml'
7818
speed:
7919
type: number
8020
minimum: 0

src/scene/schemas/SceneRecall.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type: object
2+
properties:
3+
action:
4+
type: string
5+
description: When writing active, the actions in the scene are executed on the target. dynamic_palette starts dynamic scene with colors in the Palette object.
6+
enum:
7+
- active
8+
- dynamic_palette
9+
- static
10+
duration:
11+
type: integer
12+
description: Transition to the scene within the timeframe given by duration
13+
dimming:
14+
$ref: '../../common/Dimming.yaml'

0 commit comments

Comments
 (0)