Skip to content

Commit 312e333

Browse files
authored
begin handle multiple channel
1 parent 57fa1b4 commit 312e333

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

core/class/ajaxSystem.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ public function execute($_options = array()) {
385385
'command' => $this->getLogicalId(),
386386
'deviceType' => $eqLogic->getConfiguration('device')
387387
);
388+
if($this->getConfiguration('AdditionalParam',null) != null){
389+
$command['AdditionalParam'] = $this->getConfiguration('AdditionalParam',null);
390+
}
391+
log::add('ajaxSystem','debug','Command send to ajax : '.json_encode($command));
388392
ajaxSystem::request('/user/{userId}/hubs/' . $eqLogic->getConfiguration('hub_id') . '/devices/' . $eqLogic->getLogicalId() . '/command', $command, 'POST');
389393
} else if ($eqLogic->getConfiguration('type') == 'group') {
390394
if ($this->getLogicalId() == 'ARM') {

core/config/devices/LightSwitchTwoWay.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@
5252
"template":{
5353
"dashboard" : "prise",
5454
"mobile" : "prise"
55+
},
56+
"configuration" :{
57+
"AdditionalParam" : {
58+
"ChannelsAdditionalParam" : "CHANNEL_1"
59+
}
5560
}
5661
},
5762
{
@@ -65,6 +70,11 @@
6570
"template":{
6671
"dashboard" : "prise",
6772
"mobile" : "prise"
73+
},
74+
"configuration" :{
75+
"AdditionalParam" : {
76+
"ChannelsAdditionalParam" : "CHANNEL_1"
77+
}
6878
}
6979
},
7080
{
@@ -78,6 +88,11 @@
7888
"template":{
7989
"dashboard" : "prise",
8090
"mobile" : "prise"
91+
},
92+
"configuration" :{
93+
"AdditionalParam" : {
94+
"ChannelsAdditionalParam" : "CHANNEL_2"
95+
}
8196
}
8297
},
8398
{
@@ -91,6 +106,11 @@
91106
"template":{
92107
"dashboard" : "prise",
93108
"mobile" : "prise"
109+
},
110+
"configuration" :{
111+
"AdditionalParam" : {
112+
"ChannelsAdditionalParam" : "CHANNEL_2"
113+
}
94114
}
95115
}
96116
]

0 commit comments

Comments
 (0)