User Tools

Site Tools


curves

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
curves [2020/08/03 13:33] atolstovcurves [2021/09/10 14:33] – [Get value from the curve] atolstov
Line 1: Line 1:
 +{{ :menu-icon-curves.png?nolink&60|}}
 ======Curves====== ======Curves======
 =====Introduction===== =====Introduction=====
Line 134: Line 135:
 <code lua - Getter> <code lua - Getter>
 include "curves.lib" include "curves.lib"
 +SAFE_VALUE = 10
  
 function main (userId) function main (userId)
Line 140: Line 142:
     current_hour = tonumber(t.hour)     current_hour = tonumber(t.hour)
     curve_status, y = GetCurveValue( "curve_for_current_hour", current_hour )     curve_status, y = GetCurveValue( "curve_for_current_hour", current_hour )
-    WriteReg("value_for_current_hour", y) +    if curve_status then 
 +        WriteReg("value_for_current_hour", y) 
 +    else 
 +        WriteReg("value_for_current_hour", SAFE_VALUE) 
 +    end 
 +        
  
 end end
curves.txt · Last modified: 2022/05/24 08:52 by emozolyak

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki