Skip to content

Commit

Permalink
Fix Battery decimals in Domoticz controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
enesbcs committed Feb 9, 2021
1 parent 2141c06 commit 838c2f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _C001_DomoHTTP.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ def senddata(self,idx,sensortype,value,userssi=-1,usebattery=-1,tasknum=-1,chang
url += mapRSSItoDomoticz(userssi)
if int(usebattery) != -1 and int(usebattery) != 255: # battery input 0..100%, 255 means not supported
url += "&battery="
url += str(usebattery)
url += str(int(usebattery))
else:
bval = misc.get_battery_value()
url += "&battery="
url += str(bval)
url += str(int(bval))
urlstr = self.controllerip+":"+self.controllerport+url+self.getaccountstr()
misc.addLog(rpieGlobals.LOG_LEVEL_DEBUG,urlstr) # sendviahttp
httpproc = Process(target=self.urlget, args=(urlstr,)) # use multiprocess to avoid blocking
Expand Down
4 changes: 2 additions & 2 deletions _C002_DomoMQTT.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ def senddata(self,idx,sensortype,value,userssi=-1,usebattery=-1,tasknum=-1,chang
usebattery = -1
if int(idx) > 0:
if usebattery != -1 and usebattery != 255:
bval = usebattery
bval = int(usebattery)
else:
bval = misc.get_battery_value()
bval = int(misc.get_battery_value())
msg = ""
if (int(sensortype)==rpieGlobals.SENSOR_TYPE_SWITCH):
try:
Expand Down
2 changes: 1 addition & 1 deletion rpieGlobals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Copyright (C) 2018-2020 by Alexander Nagy - https://bitekmindenhol.blog.hu/
#
PROGNAME = "RPIEasy"
BUILD = 21038
BUILD = 21040
PROGVER = str(BUILD)[:1]+"."+str(BUILD)[1:2]+"."+str(BUILD)[2:]

gpMenu = []
Expand Down

0 comments on commit 838c2f0

Please sign in to comment.