domoticz-modbus icon indicating copy to clipboard operation
domoticz-modbus copied to clipboard

Update plugin.py

Open JustKarma123 opened this issue 2 years ago • 1 comments

Lines 493, 494 and 495 had an error in the scaling applied for multiplication.

They were: if (self.Domoticz_Setting_Scale_Factor == "mul100"): value = str(value * 100, 2) if (self.Domoticz_Setting_Scale_Factor == "mul1000"): value = str(value * 1000, 3) if (self.Domoticz_Setting_Scale_Factor == "mul10000"): value = str(value * 10000, 4)

And should be as follows for scaling to work correctly. if (self.Domoticz_Setting_Scale_Factor == "mul100"): value = str(value * 100) if (self.Domoticz_Setting_Scale_Factor == "mul1000"): value = str(value * 1000) if (self.Domoticz_Setting_Scale_Factor == "mul10000"): value = str(value * 10000)

JustKarma123 avatar Sep 28 '22 10:09 JustKarma123