bobinou / iss-domo

Convert ISS Imperihome to Domoticz / Freebox / XBMC / Jeedom
https://plus.google.com/communities/113236981415459933411
9 stars 4 forks source link

[Opinion] Stopable RFY Shutter #17

Closed bebelhub closed 8 years ago

bebelhub commented 8 years ago

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; }

bobinou commented 8 years ago

I think it's a good idea....do you have test this code ? Is it working ?

bebelhub commented 8 years ago

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.

bobinou commented 8 years ago

Yes 50% is good for the UI.

Thanks for your tests