コード例 #1
0
ファイル: hm-blinds.php プロジェクト: bangnaga/HomeOverlord
 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;
 }
コード例 #2
0
ファイル: hm-onoff.php プロジェクト: bangnaga/HomeOverlord
 function setState($value, $reason = 'unknown')
 {
     SendHMCommand($this->deviceDS, 'STATE', $value == 'on' ? true : false, $reason, $this->config);
     return true;
 }