Skip to content

Commit

Permalink
No more nested objects in the ScenePut and ScenePost payloads (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
thibauult authored Feb 5, 2024
1 parent fe86f43 commit 64af0ac
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 156 deletions.
47 changes: 2 additions & 45 deletions src/scene/schemas/SceneGet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,54 +13,11 @@ allOf:
items:
$ref: './ActionGet.yaml'
metadata:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 32
description: Human readable name of a resource
image:
# description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
$ref: '../../common/ResourceIdentifier.yaml'
appdata:
type: string
minLength: 1
maxLength: 16
description: Application specific data. Free format string.
$ref: './SceneMetadata.yaml'
group:
$ref: '../../common/ResourceIdentifier.yaml'
palette:
type: object
description: Group of colors that describe the palette of colors to be used when playing dynamics
properties:
color:
type: array
minItems: 0
maxItems: 9
items:
$ref: './ColorPaletteGet.yaml'
dimming:
type: array
minItems: 0
maxItems: 1
items:
$ref: '../../common/Dimming.yaml'
color_temperature:
type: array
minItems: 0
maxItems: 1
items:
$ref: './ColorTemperaturePaletteGet.yaml'
effects:
type: array
minItems: 0
maxItems: 3
items:
type: object
properties:
effect:
$ref: '../../common/SupportedEffects.yaml'
$ref: './ScenePalette.yaml'
speed:
type: number
minimum: 0
Expand Down
14 changes: 14 additions & 0 deletions src/scene/schemas/SceneMetadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
properties:
name:
type: string
minLength: 1
maxLength: 32
description: Human readable name of a resource
image:
$ref: '../../common/ResourceIdentifier.yaml'
appdata:
type: string
minLength: 1
maxLength: 16
description: Application specific data. Free format string.
30 changes: 30 additions & 0 deletions src/scene/schemas/ScenePalette.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
type: object
description: Group of colors that describe the palette of colors to be used when playing dynamics
properties:
color:
type: array
minItems: 0
maxItems: 9
items:
$ref: './ColorPaletteGet.yaml'
dimming:
type: array
minItems: 0
maxItems: 1
items:
$ref: '../../common/Dimming.yaml'
color_temperature:
type: array
minItems: 0
maxItems: 1
items:
$ref: './ColorTemperaturePalettePost.yaml'
effects:
type: array
minItems: 0
maxItems: 3
items:
type: object
properties:
effect:
$ref: '../../common/SupportedEffects.yaml'
50 changes: 2 additions & 48 deletions src/scene/schemas/ScenePost.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,57 +14,11 @@ properties:
items:
$ref: './ActionPost.yaml'
metadata:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 32
description: Human readable name of a resource
image:
description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
$ref: '../../common/ResourceIdentifier.yaml'
appdata:
type: string
minLength: 1
maxLength: 16
description: Application specific data. Free format string.
$ref: './SceneMetadata.yaml'
group:
description: |
Group associated with this Scene. All services in the group are part of this scene.
If the group is changed the scene is update (e.g. light added/removed)
$ref: '../../common/ResourceIdentifier.yaml'
palette:
type: object
description: Group of colors that describe the palette of colors to be used when playing dynamics
properties:
color:
type: array
minItems: 0
maxItems: 9
items:
$ref: './ColorPaletteGet.yaml'
dimming:
type: array
minItems: 0
maxItems: 1
items:
$ref: '../../common/Dimming.yaml'
color_temperature:
type: array
minItems: 0
maxItems: 1
items:
$ref: './ColorTemperaturePalettePost.yaml'
effects:
type: array
minItems: 0
maxItems: 3
items:
type: object
properties:
effect:
$ref: '../../common/SupportedEffects.yaml'
$ref: './ScenePalette.yaml'
speed:
type: number
minimum: 0
Expand Down
66 changes: 3 additions & 63 deletions src/scene/schemas/ScenePut.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
type: object
required:
- actions
- metadata
- group
properties:
type:
type: string
Expand All @@ -14,67 +10,11 @@ properties:
items:
$ref: './ActionPost.yaml'
recall:
type: object
properties:
action:
type: string
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.
enum:
- active
- dynamic_palette
- static
duration:
type: integer
description: Transition to the scene within the timeframe given by duration
dimming:
$ref: '../../common/Dimming.yaml'
$ref: './SceneRecall.yaml'
metadata:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 32
description: Human readable name of a resource
image:
description: 'Reference with unique identifier for the image representing the scene only accepting “rtype”: “public_image” on creation'
$ref: '../../common/ResourceIdentifier.yaml'
appdata:
type: string
minLength: 1
maxLength: 16
description: Application specific data. Free format string.
$ref: './SceneMetadata.yaml'
palette:
type: object
description: Group of colors that describe the palette of colors to be used when playing dynamics
properties:
color:
type: array
minItems: 0
maxItems: 9
items:
$ref: './ColorPaletteGet.yaml'
dimming:
type: array
minItems: 0
maxItems: 1
items:
$ref: '../../common/Dimming.yaml'
color_temperature:
type: array
minItems: 0
maxItems: 1
items:
$ref: './ColorTemperaturePalettePost.yaml'
effects:
type: array
minItems: 0
maxItems: 3
items:
type: object
properties:
effect:
$ref: '../../common/SupportedEffects.yaml'
$ref: './ScenePalette.yaml'
speed:
type: number
minimum: 0
Expand Down
14 changes: 14 additions & 0 deletions src/scene/schemas/SceneRecall.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: object
properties:
action:
type: string
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.
enum:
- active
- dynamic_palette
- static
duration:
type: integer
description: Transition to the scene within the timeframe given by duration
dimming:
$ref: '../../common/Dimming.yaml'

0 comments on commit 64af0ac

Please sign in to comment.