mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-24 11:46:34 +00:00
Add tavern tests
This commit is contained in:
parent
5d794d16dc
commit
63ca2c13a8
10
test/config.yaml
Normal file
10
test/config.yaml
Normal file
@ -0,0 +1,10 @@
|
||||
# config.yaml
|
||||
---
|
||||
|
||||
name: Common test information
|
||||
description: Connection information for MQTT Client
|
||||
|
||||
variables:
|
||||
host: 10.4.0.5
|
||||
port: 1883
|
||||
plate: plate35
|
392
test/test_label.tavern.yaml
Normal file
392
test/test_label.tavern.yaml
Normal file
@ -0,0 +1,392 @@
|
||||
# test_page.tavern.yaml
|
||||
---
|
||||
|
||||
test_name: Label Standard Properties
|
||||
|
||||
includes:
|
||||
- !include config.yaml
|
||||
|
||||
paho-mqtt: &mqtt_spec
|
||||
client:
|
||||
transport: tcp
|
||||
client_id: tavern-tester
|
||||
connect:
|
||||
host: "{host}"
|
||||
port: !int "{port:d}"
|
||||
timeout: 3
|
||||
|
||||
stages:
|
||||
- name: Page 1
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "page 1"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "1"
|
||||
timeout: 5
|
||||
delay_after: 0.1
|
||||
|
||||
- name: Clear page
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/clearpage
|
||||
payload: ""
|
||||
delay_after: 0.1
|
||||
|
||||
- name: Create object
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/jsonl
|
||||
json:
|
||||
objid: 12
|
||||
id: 1
|
||||
delay_after: 0.1
|
||||
|
||||
- name: Set x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x=50"
|
||||
delay_after: 0.1
|
||||
- name: Get x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
x: "50"
|
||||
timeout: 5
|
||||
- name: Set x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x=25"
|
||||
- name: Get x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
x: "25"
|
||||
timeout: 5
|
||||
|
||||
- name: Set y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y=50"
|
||||
delay_after: 0.1
|
||||
- name: Get y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
y: "50"
|
||||
timeout: 5
|
||||
- name: Set y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y=25"
|
||||
delay_after: 0.1
|
||||
- name: Get y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
y: "25"
|
||||
timeout: 5
|
||||
|
||||
- name: Set w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w=50"
|
||||
delay_after: 0.1
|
||||
- name: Get w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
w: !anything
|
||||
timeout: 5
|
||||
- name: Set w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w=25"
|
||||
- name: Get w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
w: !anything
|
||||
timeout: 5
|
||||
|
||||
- name: Set h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h=50"
|
||||
delay_after: 0.1
|
||||
- name: Get h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
h: !anything
|
||||
timeout: 5
|
||||
- name: Set h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h=25"
|
||||
delay_after: 0.1
|
||||
- name: Get h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
h: !anything
|
||||
timeout: 5
|
||||
|
||||
- name: Set mode
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].mode=crop"
|
||||
delay_after: 0.1
|
||||
- name: Get mode
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].mode"
|
||||
|
||||
- name: Set w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w=50"
|
||||
delay_after: 0.1
|
||||
- name: Get w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
w: "50"
|
||||
timeout: 5
|
||||
- name: Set w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w=25"
|
||||
- name: Get w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
w: "25"
|
||||
timeout: 5
|
||||
|
||||
- name: Set h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h=50"
|
||||
delay_after: 0.1
|
||||
- name: Get h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
h: "50"
|
||||
timeout: 5
|
||||
- name: Set h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h=45"
|
||||
delay_after: 0.1
|
||||
- name: Get h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
h: "45"
|
||||
timeout: 5
|
||||
|
||||
- name: Set enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled=0"
|
||||
delay_after: 0.1
|
||||
- name: Get enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
enabled: "0"
|
||||
timeout: 5
|
||||
- name: Set enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled=1"
|
||||
delay_after: 0.1
|
||||
- name: Get enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
enabled: "1"
|
||||
timeout: 5
|
||||
|
||||
- name: Set hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden=1"
|
||||
delay_after: 0.1
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "1"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "0"
|
||||
timeout: 5
|
||||
|
||||
- name: Set hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden=0"
|
||||
delay_after: 0.1
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "0"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "1"
|
||||
timeout: 5
|
||||
|
||||
- name: Set vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis=0"
|
||||
delay_after: 0.1
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "1"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "0"
|
||||
timeout: 5
|
||||
|
||||
- name: Set vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis=1"
|
||||
delay_after: 0.1
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "0"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "1"
|
||||
timeout: 5
|
||||
|
135
test/test_mqtt.tavern.yaml
Normal file
135
test/test_mqtt.tavern.yaml
Normal file
@ -0,0 +1,135 @@
|
||||
# test_page.tavern.yaml
|
||||
---
|
||||
|
||||
test_name: Page command
|
||||
|
||||
includes:
|
||||
- !include config.yaml
|
||||
|
||||
paho-mqtt:
|
||||
client:
|
||||
transport: tcp
|
||||
client_id: tavern-tester
|
||||
connect:
|
||||
host: "{host}"
|
||||
port: !int "{port:d}"
|
||||
timeout: 3
|
||||
|
||||
stages:
|
||||
- name: step 1 - Page test
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/page
|
||||
payload: "1"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "1"
|
||||
timeout: 5
|
||||
delay_after: 1
|
||||
- name: step 2 - Page test
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "page 2"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "2"
|
||||
timeout: 5
|
||||
delay_after: 1
|
||||
- name: step 3 - Page test
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "page=3"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "3"
|
||||
timeout: 5
|
||||
delay_after: 1
|
||||
- name: step 4 - Page test
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/json
|
||||
payload: "[\"page=0\"]"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "0"
|
||||
timeout: 3
|
||||
delay_after: 1
|
||||
- name: step 5 - Page test
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/json
|
||||
payload: "[\"page 300\"]"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "0"
|
||||
timeout: 3
|
||||
delay_after: 1
|
||||
|
||||
---
|
||||
test_name: Reboot Command
|
||||
|
||||
includes:
|
||||
- !include config.yaml
|
||||
|
||||
paho-mqtt:
|
||||
client:
|
||||
transport: tcp
|
||||
client_id: tavern-tester
|
||||
connect:
|
||||
host: "{host}"
|
||||
port: !int "{port:d}"
|
||||
timeout: 3
|
||||
|
||||
stages:
|
||||
- name: Test reboot command
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/reboot
|
||||
payload: ""
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/status
|
||||
payload: "OFF"
|
||||
timeout: 20
|
||||
delay_after: 1
|
||||
|
||||
---
|
||||
test_name: Idle States
|
||||
|
||||
includes:
|
||||
- !include config.yaml
|
||||
|
||||
paho-mqtt:
|
||||
client:
|
||||
transport: tcp
|
||||
client_id: tavern-tester
|
||||
connect:
|
||||
host: "{host}"
|
||||
port: !int "{port:d}"
|
||||
timeout: 3
|
||||
|
||||
stages:
|
||||
- name: Test idle
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "wakeup"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/idle
|
||||
payload: "LONG"
|
||||
timeout: 190
|
||||
delay_after: 1
|
||||
|
||||
- name: Test idle
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "wakeup"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/idle
|
||||
payload: "SHORT"
|
||||
timeout: 70
|
||||
delay_after: 1
|
||||
|
||||
- name: Test idle
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "wakeup"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/idle
|
||||
payload: "OFF"
|
||||
timeout: 3
|
||||
delay_after: 1
|
273
test/test_obj.tavern.yaml
Normal file
273
test/test_obj.tavern.yaml
Normal file
@ -0,0 +1,273 @@
|
||||
# test_page.tavern.yaml
|
||||
---
|
||||
|
||||
test_name: Obj Standard Properties
|
||||
|
||||
includes:
|
||||
- !include config.yaml
|
||||
|
||||
paho-mqtt:
|
||||
client:
|
||||
transport: tcp
|
||||
client_id: tavern-tester
|
||||
connect:
|
||||
host: "{host}"
|
||||
port: !int "{port:d}"
|
||||
timeout: 3
|
||||
|
||||
marks:
|
||||
- parametrize:
|
||||
key: x
|
||||
vals:
|
||||
- 120
|
||||
- 80
|
||||
- parametrize:
|
||||
key: y
|
||||
vals:
|
||||
- 121
|
||||
- 81
|
||||
- parametrize:
|
||||
key: w
|
||||
vals:
|
||||
- 122
|
||||
- 82
|
||||
- parametrize:
|
||||
key: h
|
||||
vals:
|
||||
- 123
|
||||
- 83
|
||||
- parametrize:
|
||||
key: objid
|
||||
vals:
|
||||
- 10
|
||||
- 12
|
||||
- 20
|
||||
- 22
|
||||
- 30
|
||||
- 31
|
||||
- 32
|
||||
- 33
|
||||
- 40
|
||||
- 41
|
||||
- 50
|
||||
- 51
|
||||
- 91
|
||||
- parametrize:
|
||||
key:
|
||||
- hidden
|
||||
- hidden_inv
|
||||
vals:
|
||||
- [1, 0]
|
||||
- [0, 1]
|
||||
- parametrize:
|
||||
key: opacity
|
||||
vals:
|
||||
- 0
|
||||
- 127
|
||||
- 255
|
||||
- parametrize:
|
||||
key: radius
|
||||
vals:
|
||||
- 0
|
||||
- 5
|
||||
- 32535
|
||||
|
||||
stages:
|
||||
- name: Page 1
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "page 1"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/page
|
||||
payload: "1"
|
||||
timeout: 5
|
||||
delay_after: 0
|
||||
|
||||
- name: Clear page
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/clearpage
|
||||
payload: ""
|
||||
delay_after: 0
|
||||
|
||||
- name: Create object
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command/jsonl
|
||||
json:
|
||||
objid: "{objid}"
|
||||
id: 1
|
||||
delay_after: 0
|
||||
|
||||
- name: Set x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x={x}"
|
||||
delay_after: 0
|
||||
- name: Get x
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].x"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
x: "{x}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y={y}"
|
||||
delay_after: 0
|
||||
- name: Get y
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].y"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
y: "{y}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w={w}"
|
||||
delay_after: 0
|
||||
- name: Get w
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].w"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
w: "{w}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h={h}"
|
||||
delay_after: 0
|
||||
- name: Get h
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].h"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
h: "{h}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled={hidden}"
|
||||
delay_after: 0
|
||||
- name: Get enabled
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].enabled"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
enabled: "{hidden}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis={hidden}"
|
||||
delay_after: 0
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "{hidden_inv}"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "{hidden}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden={hidden}"
|
||||
delay_after: 0
|
||||
- name: Get hidden
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].hidden"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
hidden: "{hidden}"
|
||||
timeout: 5
|
||||
- name: Get vis
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].vis"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
vis: "{hidden_inv}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set opacity
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].opacity={opacity}"
|
||||
delay_after: 0
|
||||
- name: Get opacity
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].opacity"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
opacity: "{opacity}"
|
||||
timeout: 5
|
||||
|
||||
- name: Set radius
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].radius={radius}"
|
||||
delay_after: 0
|
||||
- name: Get radius
|
||||
mqtt_publish:
|
||||
topic: hasp/{plate}/command
|
||||
payload: "p[1].b[1].radius"
|
||||
mqtt_response:
|
||||
topic: hasp/{plate}/state/json
|
||||
json:
|
||||
page: 1
|
||||
id: 1
|
||||
radius: "{radius}"
|
||||
timeout: 5
|
Loading…
x
Reference in New Issue
Block a user