Skip to content

Commit 0065613

Browse files
authored
bugfix
1 parent dc2e13e commit 0065613

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

core/class/ajaxSystem.class.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,15 @@ public function execute($_options = array()) {
382382
}
383383
} else if ($eqLogic->getConfiguration('type') == 'device') {
384384
$command = array(
385-
'command' => $this->getLogicalId(),
385+
'command' => explode(" ", $this->getLogicalId())[0],
386386
'deviceType' => $eqLogic->getConfiguration('device')
387387
);
388388
if($this->getConfiguration('AdditionalParam',null) != null){
389389
$command['AdditionalParam'] = $this->getConfiguration('AdditionalParam',null);
390390
}
391+
if(!isset($command['command']) || $command['command'] == ''){
392+
$command['command'] = $this->getLogicalId();
393+
}
391394
log::add('ajaxSystem','debug','Command send to ajax : '.json_encode($command));
392395
ajaxSystem::request('/user/{userId}/hubs/' . $eqLogic->getConfiguration('hub_id') . '/devices/' . $eqLogic->getLogicalId() . '/command', $command, 'POST');
393396
} else if ($eqLogic->getConfiguration('type') == 'group') {

core/config/devices/LightSwitchTwoWay.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"subtype": "other",
4848
"isVisible": 1,
4949
"isHistorized": 0,
50-
"logicalId": "SWITCH_ON",
50+
"logicalId": "SWITCH_ON 1",
5151
"value" :"Etat 1",
5252
"template":{
5353
"dashboard" : "prise",
@@ -65,7 +65,7 @@
6565
"subtype": "other",
6666
"isVisible": 1,
6767
"isHistorized": 0,
68-
"logicalId": "SWITCH_OFF",
68+
"logicalId": "SWITCH_OFF 1",
6969
"value" :"Etat 1",
7070
"template":{
7171
"dashboard" : "prise",
@@ -83,7 +83,7 @@
8383
"subtype": "other",
8484
"isVisible": 1,
8585
"isHistorized": 0,
86-
"logicalId": "SWITCH_ON",
86+
"logicalId": "SWITCH_ON 2",
8787
"value" :"Etat 2",
8888
"template":{
8989
"dashboard" : "prise",
@@ -101,7 +101,7 @@
101101
"subtype": "other",
102102
"isVisible": 1,
103103
"isHistorized": 0,
104-
"logicalId": "SWITCH_OFF",
104+
"logicalId": "SWITCH_OFF 2",
105105
"value" :"Etat 2",
106106
"template":{
107107
"dashboard" : "prise",

0 commit comments

Comments
 (0)