Skip to content

Commit

Permalink
[mock] fix room motionsensor mount ref
Browse files Browse the repository at this point in the history
  • Loading branch information
silveryfu committed Apr 12, 2021
1 parent 4990246 commit f7a9425
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 4 deletions.
2 changes: 1 addition & 1 deletion runtime/mocks/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ r := $(KIND)s
n := $(KIND)-test
ns := default

test: | all
test: | model all
cd ./$(KIND)/test; $(kc) delete $(KIND) $(n); $(kc) apply -f cr.yaml
cp ./$(KIND)/driver/handler.py $(driver_templates); \
GROUP=$(g) VERSION=$(v) PLURAL=$(r) NAME=$(n) NAMESPACE=$(ns) MOUNTER=$(MOUNTER) \
Expand Down
24 changes: 23 additions & 1 deletion runtime/mocks/home/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,35 @@ spec:
type: string
type: object
type: object
mock.digi.dev/v1/motionsensor:
mock.digi.dev/v1/motionsensors:
additionalProperties:
properties:
generation:
type: number
mode:
type: string
spec:
properties:
control:
properties:
sensitivity:
properties:
intent:
type: number
status:
type: number
type: object
type: object
obs:
properties:
battery_level:
type: string
last_triggered_time:
type: number
reason:
type: string
type: object
type: object
status:
type: string
type: object
Expand Down
24 changes: 23 additions & 1 deletion runtime/mocks/room/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,35 @@ spec:
type: string
type: object
type: object
mock.digi.dev/v1/motionsensor:
mock.digi.dev/v1/motionsensors:
additionalProperties:
properties:
generation:
type: number
mode:
type: string
spec:
properties:
control:
properties:
sensitivity:
properties:
intent:
type: number
status:
type: number
type: object
type: object
obs:
properties:
battery_level:
type: string
last_triggered_time:
type: number
reason:
type: string
type: object
type: object
status:
type: string
type: object
Expand Down
2 changes: 1 addition & 1 deletion runtime/mocks/room/model.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ reflex: object
mount:
mock.digi.dev/v1/unilamps: object
mock.digi.dev/v1/colorlamps: object
mock.digi.dev/v1/motionsensor: object
mock.digi.dev/v1/motionsensors: object

6 changes: 6 additions & 0 deletions runtime/mocks/room/test/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ spec:
intent: 0.8
mode:
intent: idle
reflex:
motion-mode:
policy: 'if $time - ."motionsensor-test".obs.last_triggered_time <= 600
then .root.control.mode.intent = "work" else . end'
priority: -1
processor: jq

0 comments on commit f7a9425

Please sign in to comment.