Skip to content

Commit f8084b3

Browse files
authored
Merge pull request #49 from jeedom/beta
Stable
2 parents c35ce3c + be81f68 commit f8084b3

27 files changed

Lines changed: 655 additions & 431 deletions

.github/workflows/translations.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: translate
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- beta
8+
9+
jobs:
10+
auto-translate:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: jeedom/jeetranslate@main
14+
with:
15+
deepl_api_key: ${{ secrets.DEEPL_API_KEY }}
16+
include_empty_translation: false
17+
target_languages: "en_US,es_ES,de_DE,it_IT,pt_PT"
18+
use_core_translations: true

core/class/ajaxSystem.class.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,9 +382,22 @@ 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
);
388+
if($this->getConfiguration('AdditionalParam',null) != null){
389+
$command['AdditionalParam'] = $this->getConfiguration('AdditionalParam',null);
390+
}
391+
if(!isset($command['command']) || $command['command'] == ''){
392+
$command['command'] = $this->getLogicalId();
393+
}
394+
if(isset(explode(" ", $this->getLogicalId())[1]) && explode(" ", $this->getLogicalId())[1] != ""){
395+
$command['additionalParam'] = array(
396+
'additionalParamType' => 'CHANNELS',
397+
'channels' => array("CHANNEL_".explode(" ", $this->getLogicalId())[1])
398+
);
399+
}
400+
log::add('ajaxSystem','debug','Command send to ajax : '.json_encode($command));
388401
ajaxSystem::request('/user/{userId}/hubs/' . $eqLogic->getConfiguration('hub_id') . '/devices/' . $eqLogic->getLogicalId() . '/command', $command, 'POST');
389402
} else if ($eqLogic->getConfiguration('type') == 'group') {
390403
if ($this->getLogicalId() == 'ARM') {
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"name" : "Interrupteur double va et vient",
3+
"commands" : [
4+
{
5+
"name": "Etat 1",
6+
"type": "info",
7+
"subtype": "binary",
8+
"isVisible": 0,
9+
"isHistorized": 0,
10+
"logicalId": "channelStatus_1"
11+
},
12+
{
13+
"name": "Etat 2",
14+
"type": "info",
15+
"subtype": "binary",
16+
"isVisible": 0,
17+
"isHistorized": 0,
18+
"logicalId": "channelStatus_2"
19+
},
20+
{
21+
"name": "Source evenement",
22+
"type": "info",
23+
"subtype": "string",
24+
"isVisible": 0,
25+
"isHistorized": 0,
26+
"logicalId": "sourceObjectName"
27+
},
28+
{
29+
"name": "Evenement",
30+
"type": "info",
31+
"subtype": "string",
32+
"isVisible": 0,
33+
"isHistorized": 0,
34+
"logicalId": "event"
35+
},
36+
{
37+
"name": "Code evenement",
38+
"type": "info",
39+
"subtype": "string",
40+
"isVisible": 0,
41+
"isHistorized": 0,
42+
"logicalId": "eventCode"
43+
},
44+
{
45+
"name": "On 1",
46+
"type": "action",
47+
"subtype": "other",
48+
"isVisible": 1,
49+
"isHistorized": 0,
50+
"logicalId": "SWITCH_ON 1",
51+
"value" :"Etat 1",
52+
"template":{
53+
"dashboard" : "prise",
54+
"mobile" : "prise"
55+
},
56+
"configuration" :{
57+
"AdditionalParam" : {
58+
"ChannelsAdditionalParam" : "CHANNEL_1"
59+
}
60+
}
61+
},
62+
{
63+
"name": "Off 1",
64+
"type": "action",
65+
"subtype": "other",
66+
"isVisible": 1,
67+
"isHistorized": 0,
68+
"logicalId": "SWITCH_OFF 1",
69+
"value" :"Etat 1",
70+
"template":{
71+
"dashboard" : "prise",
72+
"mobile" : "prise"
73+
},
74+
"configuration" :{
75+
"AdditionalParam" : {
76+
"ChannelsAdditionalParam" : "CHANNEL_1"
77+
}
78+
}
79+
},
80+
{
81+
"name": "On 2",
82+
"type": "action",
83+
"subtype": "other",
84+
"isVisible": 1,
85+
"isHistorized": 0,
86+
"logicalId": "SWITCH_ON 2",
87+
"value" :"Etat 2",
88+
"template":{
89+
"dashboard" : "prise",
90+
"mobile" : "prise"
91+
}
92+
},
93+
{
94+
"name": "Off 2",
95+
"type": "action",
96+
"subtype": "other",
97+
"isVisible": 1,
98+
"isHistorized": 0,
99+
"logicalId": "SWITCH_OFF 2",
100+
"value" :"Etat 2",
101+
"template":{
102+
"dashboard" : "prise",
103+
"mobile" : "prise"
104+
}
105+
}
106+
]
107+
}
3.24 KB
Loading
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"name" : "Interrupteur double",
3+
"commands" : [
4+
{
5+
"name": "Etat 1",
6+
"type": "info",
7+
"subtype": "binary",
8+
"isVisible": 0,
9+
"isHistorized": 0,
10+
"logicalId": "channelStatus_1"
11+
},
12+
{
13+
"name": "Etat 2",
14+
"type": "info",
15+
"subtype": "binary",
16+
"isVisible": 0,
17+
"isHistorized": 0,
18+
"logicalId": "channelStatus_2"
19+
},
20+
{
21+
"name": "Source evenement",
22+
"type": "info",
23+
"subtype": "string",
24+
"isVisible": 0,
25+
"isHistorized": 0,
26+
"logicalId": "sourceObjectName"
27+
},
28+
{
29+
"name": "Evenement",
30+
"type": "info",
31+
"subtype": "string",
32+
"isVisible": 0,
33+
"isHistorized": 0,
34+
"logicalId": "event"
35+
},
36+
{
37+
"name": "Code evenement",
38+
"type": "info",
39+
"subtype": "string",
40+
"isVisible": 0,
41+
"isHistorized": 0,
42+
"logicalId": "eventCode"
43+
},
44+
{
45+
"name": "On 1",
46+
"type": "action",
47+
"subtype": "other",
48+
"isVisible": 1,
49+
"isHistorized": 0,
50+
"logicalId": "SWITCH_ON 1",
51+
"value" :"Etat 1",
52+
"template":{
53+
"dashboard" : "prise",
54+
"mobile" : "prise"
55+
},
56+
"configuration" :{
57+
"AdditionalParam" : {
58+
"ChannelsAdditionalParam" : "CHANNEL_1"
59+
}
60+
}
61+
},
62+
{
63+
"name": "Off 1",
64+
"type": "action",
65+
"subtype": "other",
66+
"isVisible": 1,
67+
"isHistorized": 0,
68+
"logicalId": "SWITCH_OFF 1",
69+
"value" :"Etat 1",
70+
"template":{
71+
"dashboard" : "prise",
72+
"mobile" : "prise"
73+
},
74+
"configuration" :{
75+
"AdditionalParam" : {
76+
"ChannelsAdditionalParam" : "CHANNEL_1"
77+
}
78+
}
79+
},
80+
{
81+
"name": "On 2",
82+
"type": "action",
83+
"subtype": "other",
84+
"isVisible": 1,
85+
"isHistorized": 0,
86+
"logicalId": "SWITCH_ON 2",
87+
"value" :"Etat 2",
88+
"template":{
89+
"dashboard" : "prise",
90+
"mobile" : "prise"
91+
}
92+
},
93+
{
94+
"name": "Off 2",
95+
"type": "action",
96+
"subtype": "other",
97+
"isVisible": 1,
98+
"isHistorized": 0,
99+
"logicalId": "SWITCH_OFF 2",
100+
"value" :"Etat 2",
101+
"template":{
102+
"dashboard" : "prise",
103+
"mobile" : "prise"
104+
}
105+
}
106+
]
107+
}
3.24 KB
Loading

core/config/devices/LightSwitchTwoWay.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060
}
6161
}
6262
]
63-
}
63+
}

0 commit comments

Comments
 (0)