Bonjour @lunarok
J’ai 2 petite proposition de correction du plugin KLF200.
1/ Si on fait un stop, il est intéressant de faire un refresh pour avoir immédiatement la position du volet
Dans le fichier klf200.class.php :
public function sendAction($_action, $_value) {
$uri = '/' . $_action . '/' . urlencode($this->getConfiguration('id'));
if (($_action == 'set') || ($_action == 'lightset')) {
$uri .= '/' . $_value;
}
log::add('klf200', 'debug', 'Action ' . $uri);
$result = klf200::sendCommand($uri);
//$this->refresh(); //not needed as just after action it doesn't have move
// début ajout
if ($_action == 'stop') {
$this->refresh();
}
// fin ajout
}
2/ Le positionnement d’un groupe de velux est buggé : il manque le code pour gérer le pourcentage d’ouverture et non de fermeture
Dans le fichier klf200.class.php :
public function execute($_options = null) {
if ($this->getType() == 'action') {
$eqLogic = $this->getEqLogic();
if ($eqLogic->getConfiguration('id') == '99') {
$eqLogics = klf200::byType('klf200', true);
foreach ($eqLogics as $klf200) {
if ($klf200->getConfiguration('id') == '99') {
continue;
}
if ($klf200->getConfiguration('type') == $eqLogic->getConfiguration('type')) {
if ($this->getLogicalId() == 'refresh') {
$klf200->refresh();
} else {
if ($this->getLogicalId() == 'stop') {
$value = 'stop';
} elseif ($this->getSubType() == 'slider') {
$value = $_options['slider'];
// début ajout
if ($this->getLogicalId() == 'position_sliderOpen') {
$value = 100 - $value;
}
// fin ajout
} else {
$value = $this->getConfiguration('value');
}
$klf200->sendAction($this->getConfiguration('action'),$value);
}
}
}
} else {
if ($this->getLogicalId() == 'refresh') {
$eqLogic->refresh();
} else {
if ($this->getSubType() == 'slider') {
$value = $_options['slider'];
if ($this->getLogicalId() == 'position_sliderOpen') {
$value = 100 - $value;
}
} else {
$value = $this->getConfiguration('value');
}
$eqLogic->sendAction($this->getConfiguration('action'),$value);
}
}
}
}