Skip to content

Commit

Permalink
experiment with new command/response formats
Browse files Browse the repository at this point in the history
  • Loading branch information
rsnodgrass committed Nov 18, 2023
1 parent cc382b2 commit 4f2ce30
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
16 changes: 15 additions & 1 deletion pyxantech/protocols/monoprice.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,21 @@
min: 1
max: 6

format:
command:
format: "<{command}{eol}"
eol: ""
separator: '#'

query:
format: "?{command}{eol}"

response:
format: ">{response}"
eol: "\r"
separator: '#'

response_eol: "\r"
command_eol: "\r"
command_separator: "#"

Expand All @@ -48,7 +63,6 @@
set_balance: '<{zone}BL{balance:02}' # balance: 0-20
set_source: '<{zone}CH{source:02}' # source: 0-6

response_eol: "\r"

responses:
zone_status: '#>(?P<zone>\d\d)(?P<power>[01]{2})(?P<source>\d\d)(?P<mute>[01]{2})(?P<do_not_disturb>[01])(?P<volume>\d\d)(?P<treble>\d\d)(?P<bass>\d\d)(?P<balance>\d\d)(?P<unknown>\d\d)(?P<keypad>\d\d)'
Expand Down
33 changes: 33 additions & 0 deletions pyxantech/protocols/xantech.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@
command_eol: ""
command_separator: "+"

format:
command:
format: "!{command}{eol}"
eol: ""
separator: '#'

query:
format: "?{command}{eol}"

response:
format: "{response}"
eol: "\r"
separator: '#'


commands:
zone_status: '?{zone}ZD'
zone_details: '?{zone}ZD'
Expand Down Expand Up @@ -80,6 +95,24 @@
set_activity_updates: '!ZA{activity_updates}' # activity_updates: 1 = on; 0 = off
set_status_updates: '!ZP{status_updates}' # status_updates: 1 = on; 0 = off

commands_v2:
power:
status:
command: '?{zone}PR'
response: '\?(?P<zone>\d+)PR(?P<power>[01])\+'
set:
command: "!{zone}PR{power}"
'on':
command: '!{zone}PR1'
'off':
command: '!{zone}PR0'
toggle:
command: '!{zone}PT'
all_zones_off:
command: '!AO'



response_eol: "\r"
response_separator: "#"

Expand Down

0 comments on commit 4f2ce30

Please sign in to comment.