Closed bebelhub closed 8 years ago
I think it's a good idea....do you have test this code ? Is it working ?
I have some additional tests to do this evening. If it works as expected, I'll push it.
What do think about the 50% value for the "stopped" state ? That allows the UI to display it's not open neither closed.
Yes 50% is good for the UI.
Thanks for your tests
My RFY shutters have the stopable capability (Somfy).
What do you think about make it stopable in DomoticzController.php ?
case 'RFY': $output = array( array( 'key' => 'Level', 'value' => 'Closed' == $device['Status'] ? '0' : 'Open' == $device['Status'] ? '100' : '50', ), array( 'key' => 'stopable', 'value' => '1', ), array( 'key' => 'pulseable', 'value' => '0', )); break;
And change the action function accordingly:
//*** For Dimmer, Blinds *** if($actionName == 'setLevel' OR $actionName == 'stopShutter'){ if(strpos($deviceId, 'noroom')){ $arraydeviceId = explode("-", $deviceId); $deviceId = $arraydeviceId[0]; } $actionName = 'setLevel' == $actionName ? 'switchlight' : $actionName; $actionName = 'stopShutter' == $actionName ? 'switchlight' : $actionName; switch($actionParam){ case '0': $actionParam = 'On'; break; case '100': $actionParam = 'Off'; break; default: $actionParam = 'Stop'; break; }