You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This needs new type and a proper math adjustment.
Plus, everything related to serialization needs to know of these different conversion rules. Right now it only understands kWh + Ws
The text was updated successfully, but these errors were encountered:
subj
Current conversion does truncation
espurna/code/espurna/sensor.h
Lines 86 to 88 in 5f6df82
https://en.cppreference.com/w/cpp/language/operator_arithmetic#Conversions
https://en.cppreference.com/w/cpp/language/implicit_conversion#Floating.E2.80.93integral_conversions
For example, sensor read 0.9W over 1 second will result in 0. Longer interval will eventually allow for the value to appear, but this may also result in loss of precision when it is truncated to the integer part.
Current
Energy
pair is kWh + Ws, which could become kWh + mWs insteadespurna/code/espurna/sensor.h
Lines 141 to 144 in 5f6df82
This needs new type and a proper math adjustment.
Plus, everything related to serialization needs to know of these different conversion rules. Right now it only understands kWh + Ws
The text was updated successfully, but these errors were encountered: