Перейти к содержанию

Навигация

Rule Examples/en: различия между версиями

Нет описания правки
Строка 169: Строка 169:
   var relay_down_control = "Relay 2";
   var relay_down_control = "Relay 2";


   <div class="mw-translate-fuzzy">
   var timeout_s = 15;
var timeout_s = 15;
    
    
   // End of settings
   // End of settings
Строка 180: Строка 179:
   defineRule( "roller_shutter_up_on" + suffix, {
   defineRule( "roller_shutter_up_on" + suffix, {
   asSoonAs: function() {
   asSoonAs: function() {
     return dev[relay_up_device][relay_up_control];
     return dev["relay_up_device/relay_up_control"];
   },
   },
     then: function () {
     then: function () {
Строка 186: Строка 185:
         relay_up_timer_id = clearTimeout(relay_up_timer_id);  
         relay_up_timer_id = clearTimeout(relay_up_timer_id);  
       };
       };
</div>


       <div class="mw-translate-fuzzy">
       relay_up_timer_id = setTimeout(function() {
relay_up_timer_id = setTimeout(function() {
         return dev["relay_up_device/relay_up_control"] = 0;
         return dev[relay_up_device][relay_up_control] = 0;
       }, timeout_s * 1000);
       }, timeout_s * 1000);
     }
     }
   });
   });
</div>


   <div class="mw-translate-fuzzy">
   defineRule("roller_shutter_down_on" + suffix, {
defineRule("roller_shutter_down_on" + suffix, {
     asSoonAs: function() {
     asSoonAs: function() {
       return dev[relay_down_device][relay_down_control];
       return dev[relay_down_device][relay_down_control];
Строка 207: Строка 202:
        
        
       relay_down_timer_id = setTimeout(function() {
       relay_down_timer_id = setTimeout(function() {
         dev[relay_down_device][relay_down_control] = 0;
         dev["relay_down_device/relay_down_control"] = 0;
       }, timeout_s * 1000);
       }, timeout_s * 1000);
     }
     }
   });
   });
</div>


   <div class="mw-translate-fuzzy">
   defineRule("roller_shutter_both_on" + suffix, {
defineRule("roller_shutter_both_on" + suffix, {
     asSoonAs: function() {
     asSoonAs: function() {
       return dev[relay_up_device][relay_up_control] && dev[relay_down_device][relay_down_control];
       return dev[relay_up_device][relay_up_control] && dev["relay_down_device/relay_down_control"];
     },
     },
     then: function () {
     then: function () {
Строка 222: Строка 215:
         relay_up_timer_id = clearTimeout(relay_up_timer_id);  
         relay_up_timer_id = clearTimeout(relay_up_timer_id);  
       };
       };
</div>


       if (relay_down_timer_id) {
       if (relay_down_timer_id) {
translator, wb_editors
4265

правок