Translations:Rule Examples/195/en

Материал из Wiren Board
Версия от 20:42, 21 сентября 2022; Matveevrj (обсуждение | вклад) (Новая страница: «defineRule("water_meter_1", { whenChanged: "wb-mcm8_29/Input 1 counter", then: function(newValue, devName, cellName) { if(newValue){ dev["water_meters"]["water_meter_1"] = ((parseInt(newValue) - counterCorrection) * inpulseValue) + meterCorrection; // We multiply the value of the counter by the number of liters / pulse and add the correction value. } } }); </syntaxhighlight>»)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)

defineRule("water_meter_1", {

   whenChanged: "wb-mcm8_29/Input 1 counter",
   then: function(newValue, devName, cellName) {
     if(newValue){
     dev["water_meters"]["water_meter_1"] = ((parseInt(newValue) - counterCorrection) * inpulseValue) + meterCorrection; // We multiply the value of the counter by the number of liters / pulse and add the correction value.
     }
   }

}); </syntaxhighlight>