Skip to content

Commit

Permalink
Implementation de lb1
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and jbsky committed Feb 25, 2021
1 parent c90f039 commit efc2289
Show file tree
Hide file tree
Showing 6 changed files with 488 additions and 54 deletions.
21 changes: 20 additions & 1 deletion core/class/broadlink.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,27 @@ public function execute($_options = null) {
break;
default:
$finalValue = trim($value[1]);
break;
}
if ($value[0] == 'pwr')
$data[trim($value[0])] = intval($finalValue);
else
$data[trim($value[0])] = $finalValue;
}
if (count($value) == 1) {
switch ($this->getSubType()) {
case 'color':
if (implode (",", $values) == "rgbAct")
$r=implode (",", $_options);
$rgb=substr(ltrim($r, $r[0]),0,6);
$data['red'] = hexdec (substr($rgb,0,2));
$data['green'] = hexdec (substr($rgb,2,2));
$data['blue'] = hexdec (substr($rgb,4,2));
break;
case 'slider':
$data[substr(implode (",", $values), 0, -3)] = intval(ltrim(implode (",", $_options),','));
break;
}
$data[trim($value[0])] = $finalValue;
}
}
$data['ip'] = $eqLogic->getConfiguration('ip');
Expand Down
272 changes: 272 additions & 0 deletions core/config/devices/bulb/lb1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
{
"lb1": {
"name": "SmartBulb",
"groupe" : "Lumière",
"category" : {
"light" : 1
},
"configuration" : {
"device" : "lb1",
"delay" : 300,
"canlearn" : 0,
"ischild" :0
},
"commands": [{
"name": "pwr",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "pwr",
"configuration" : {
"logicalid" : "pwr"
},
"template": {
"dashboard": "light",
"mobile": "light"
}
},{
"name": "brightness",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "brightness",
"configuration" : {
"logicalid" : "brightness"
}
},{
"name": "colortemp",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "colortemp",
"configuration" : {
"logicalid" : "colortemp"
}
},{
"name": "hue",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "hue",
"configuration" : {
"logicalid" : "hue"
}
},{
"name": "saturation",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "saturation",
"configuration" : {
"logicalid" : "saturation"
}
},{
"name": "transitionduration",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "ms",
"logicalId": "transitionduration",
"configuration" : {
"logicalid" : "transitionduration"
}
},{
"name": "maxworktime",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "s",
"logicalId": "maxworktime",
"configuration" : {
"logicalid" : "maxworktime"
}
},{
"name": "Mode",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "bulb_colormode",
"configuration" : {
"logicalid" : "bulb_colormode",
"minValue" : 0,
"maxValue" : 2
}
},{
"name": "Scene",
"type": "info",
"subtype": "numeric",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "bulb_sceneidx",
"configuration" : {
"logicalid" : "bulb_sceneidx"
}
},{
"name": "Allumer",
"type": "action",
"subtype": "other",
"display": {
"icon": "<i class=\"fas fa-lightbulb\"><\/i>",
"generic_type": "LIGHT_ON"
},
"isVisible": 1,
"logicalId": "pwr:1"
},{
"name": "Eteindre",
"type": "action",
"subtype": "other",
"display": {
"icon": "<i class=\"fas fa-power-off\"><\/i>",
"generic_type": "LIGHT_OFF"
},
"isVisible": 1,
"logicalId": "pwr:0"
},{
"name": "_Couleur",
"type": "action",
"subtype": "color",
"display": {
"generic_type": "LIGHT_SET_COLOR"
},
"configuration" : {
"request" : "rgbAct"
},
"isVisible": 1,
"logicalId": "rgbAct"
},{
"name": "_Luminosité",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 1
},
"configuration" : {
"request" : "brightnessAct",
"minValue" : 0,
"maxValue" : 100
},
"isVisible": 1,
"logicalId": "brightnessAct"
},{
"name": "_Hue",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 0
},
"configuration" : {
"request" : "hueAct",
"minValue" : 0,
"maxValue" : 360
},
"isVisible": 1,
"logicalId": "hueAct"
},{
"name": "_Saturation",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 0
},
"configuration" : {
"request" : "saturationAct",
"minValue" : 0,
"maxValue" : 100
},
"isVisible": 1,
"logicalId": "saturationAct"
},{
"name": "_Transition",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 0
},
"configuration" : {
"request" : "transitiondurationAct",
"minValue" : 0,
"maxValue" : 10000
},
"isVisible": 1,
"logicalId": "transitiondurationAct"
},{
"name": "Timer",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 1
},
"configuration" : {
"request" : "maxworktimeAct",
"minValue" : 0,
"maxValue" : 360
},
"isVisible": 1,
"logicalId": "maxworktimeAct"
},{
"name": "_Mode",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 0
},
"configuration" : {
"request" : "bulb_colormodeAct",
"minValue" : 0,
"maxValue" : 2
},
"isVisible": 1,
"value": "Luminosité Info",
"logicalId": "bulb_colormodeAct"
},{
"name": "_Scene",
"type": "action",
"subtype": "slider",
"display": {
"generic_type": "LIGHT_SLIDER",
"forceReturnLineBefore": 0
},
"configuration" : {
"request" : "bulb_sceneidxAct",
"minValue" : 0,
"maxValue" : 7
},
"isVisible": 1,
"value": "Luminosité Info",
"logicalId": "bulb_sceneidxAct"
},{
"name": "Rafraîchir",
"type": "action",
"subtype": "other",
"isVisible": 1,
"isHistorized": 0,
"unite": "",
"logicalId": "refresh",
"configuration" : {
"logicalid" : "refresh"
}
}
]
}
}
Binary file added core/config/devices/bulb/lb1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit efc2289

Please sign in to comment.