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

Материал из Wiren Board
(Импортирована новая версия из внешнего источника)
 
(Импортирована новая версия из внешнего источника)
 
Строка 1: Строка 1:
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"];
     },
     },
     then: function () {
     then: function () {
Строка 9: Строка 9:
        
        
       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);
     }
     }
   });
   });

Текущая версия на 21:46, 21 сентября 2022

Определение сообщения (Rule Examples)
defineRule("roller_shutter_down_on" + suffix, {
   asSoonAs: function() {
     return dev["relay_down_device/relay_down_control"];
   },
   then: function () {
     if (relay_down_timer_id) {
       relay_down_timer_id = clearTimeout(relay_down_timer_id); 
     };
      
     relay_down_timer_id = setTimeout(function() {
       dev["relay_down_device/relay_down_control"] = 0;
     }, timeout_s * 1000);
   }
  });

defineRule("roller_shutter_down_on" + suffix, {

   asSoonAs: function() {
     return dev["relay_down_device/relay_down_control"];
   },
   then: function () {
     if (relay_down_timer_id) {
       relay_down_timer_id = clearTimeout(relay_down_timer_id); 
     };
     
     relay_down_timer_id = setTimeout(function() {
       dev["relay_down_device/relay_down_control"] = 0;
     }, timeout_s * 1000);
   }
 });