Skip to content

Commit

Permalink
modified mastervalue.cgi/mastervaluechange.cgi to automatically ident…
Browse files Browse the repository at this point in the history
…ify HMIP devices and query the HMIP xmlrpc port (2010) instead. This closes #14 and #13.
  • Loading branch information
jens-maus committed Aug 29, 2018
1 parent f71e2d1 commit 662ac17
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 6 additions & 4 deletions xmlapi/mastervalue.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ foreach devid $devids {

puts -nonewline $values(STDOUT)

if {$deviceType=="HM-CC-VG-1"} {
if {[string first "HM-CC-VG-" $deviceType] >= 0} {
set ausgabe [xmlrpc http://127.0.0.1:9292/groups getParamset [list string $deviceAddress] [list string "MASTER"] ]
} else {
set ausgabe [xmlrpc http://127.0.0.1:2001/ getParamset [list string $deviceAddress] [list string "MASTER"] ]
} elseif {[string first "HMIP-" $deviceType] >= 0} {
set ausgabe [xmlrpc http://127.0.0.1:2010/ getParamset [list string $deviceAddress] [list string "MASTER"] ]
} else {
set ausgabe [xmlrpc http://127.0.0.1:2001/ getParamset [list string $deviceAddress] [list string "MASTER"] ]
}

foreach { bezeichnung wert } $ausgabe {
Expand All @@ -67,4 +69,4 @@ foreach devid $devids {
}
puts -nonewline {</device>}
}
puts -nonewline {</mastervalue>}
puts -nonewline {</mastervalue>}
8 changes: 5 additions & 3 deletions xmlapi/mastervaluechange.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ for {set counter 0} {$counter<[llength $rec_devids]} {incr counter} {

puts -nonewline $values(STDOUT)

if {$deviceType=="HM-CC-VG-1"} {
if {[string first "HM-CC-VG-" $deviceType] >= 0} {
set ausgabe [xmlrpc http://127.0.0.1:9292/groups putParamset [list string $deviceAddress] [list string "MASTER"] [list struct $cmd]]
} else {
set ausgabe [xmlrpc http://127.0.0.1:2001/ putParamset [list string $deviceAddress] [list string "MASTER"] [list struct $cmd]]
} elseif {[string first "HMIP-" $deviceType] >= 0} {
set ausgabe [xmlrpc http://127.0.0.1:2010/ putParamset [list string $deviceAddress] [list string "MASTER"] [list struct $cmd]]
} else {
set ausgabe [xmlrpc http://127.0.0.1:2001/ putParamset [list string $deviceAddress] [list string "MASTER"] [list struct $cmd]]
}
puts -nonewline {<mastervalue name='}
puts -nonewline $item
Expand Down

0 comments on commit 662ac17

Please sign in to comment.