Example #1
0
 function setState($value, $reason = 'unknown')
 {
     $result = 0;
     switch ($value) {
         case 'closed':
             $result = $this->fullyClosed * 1.0;
             break;
         case '25% open':
             $result = $this->fullyClosed * 0.75;
             break;
         case '50% open':
             $result = $this->fullyClosed * 0.5;
             break;
         case '75% open':
             $result = $this->fullyClosed * 0.25;
             break;
         case 'open':
             $result = 0;
             break;
     }
     print_r(SendHMCommand($this->deviceDS, 'LEVEL', $result, $reason, $this->config));
     return true;
 }
Example #2
0
 function setState($value, $reason = 'unknown')
 {
     SendHMCommand($this->deviceDS, 'STATE', $value == 'on' ? true : false, $reason, $this->config);
     return true;
 }