Skip to content

Commit

Permalink
Merge pull request #155 from Jeedom-Zigate/develop
Browse files Browse the repository at this point in the history
Fix color temp | add cover
  • Loading branch information
doudz authored Mar 4, 2019
2 parents bd2fc9d + 366a0bf commit af56663
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions core/class/zigate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,23 @@ public function createCommands($device)
array_push($created_commands, $key);
break;
case 'temperature':
$key = $this->_create_action($endpoint_id, $action, 'temperature', 'slider', [1700, 6500]);
$key = $this->_create_action($endpoint_id, $action, 'temperature', 'slider', [153, 500]);
array_push($created_commands, $key);
break;
case 'hue':
$key = $this->_create_action($endpoint_id, $action, 'hue', 'color');
array_push($created_commands, $key);
break;
case 'cover':
$key = $this->_create_action($endpoint_id, $action, 'open', 'other', 0);
array_push($created_commands, $key);

$key = $this->_create_action($endpoint_id, $action, 'close', 'other', 1);
array_push($created_commands, $key);

$key = $this->_create_action($endpoint_id, $action, 'stop', 'other', 2);
array_push($created_commands, $key);
break;
}
}
}
Expand Down Expand Up @@ -430,8 +440,8 @@ public function _create_command($endpoint_id, $cluster_id, $attribute)
$cmd_info->setConfiguration('maxValue', 100);
}
if ($name == 'colour_temperature') {
$cmd_info->setConfiguration('minValue', 1700);
$cmd_info->setConfiguration('maxValue', 6500);
$cmd_info->setConfiguration('minValue', 153);
$cmd_info->setConfiguration('maxValue', 500);
}
break;
case 'double':
Expand Down Expand Up @@ -904,13 +914,17 @@ public function execute($_options = [])
break;

case 'temperature':
// min 1700 max 6500
zigate::CallZiGate('action_move_temperature_kelvin', [$addr, $endpoint, $value]);
// mired : min 153 max 500
zigate::CallZiGate('action_move_temperature', [$addr, $endpoint, $value]);
break;

case 'hue':
zigate::CallZiGate('action_move_hue_hex', [$addr, $endpoint, $value]);
break;

case 'cover':
zigate::CallZiGate('action_cover', [$addr, $endpoint, $value]);
break;

case 'refresh':
zigate::callZiGate('refresh_device', [$addr]);
Expand Down
2 changes: 1 addition & 1 deletion plugin_info/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@
"documentation": "https://jeedom-zigate.github.io/jeedom-plugin-zigate",
"language": ["fr_FR", "en_US"],
"compatibility": ["Jeedomboard", "RPI/RPI2", "Docker", "DIY"],
"pluginVersion": "1.2.3-b3"
"pluginVersion": "1.2.3-b4"
}

0 comments on commit af56663

Please sign in to comment.