Skip to content

Commit

Permalink
Accept "Battery" to be an int but also a float
Browse files Browse the repository at this point in the history
  • Loading branch information
pipiche38 authored Jan 11, 2025
1 parent 8f2b6f7 commit 50304da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/WebServer/WebServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,8 +1082,8 @@ def rest_zDevice(self, verb, data, parameters):
if attribut == "Battery" and attribut in self.ListOfDevices[item]:
if self.ListOfDevices[item]["Battery"] in ( {}, ) and "IASBattery" in self.ListOfDevices[item]:
device[attribut] = str(self.ListOfDevices[item][ "IASBattery" ])
elif isinstance( self.ListOfDevices[item]["Battery"], int):
device[attribut] = self.ListOfDevices[item]["Battery"]
elif isinstance( self.ListOfDevices[item]["Battery"], (int,float)):
device[attribut] = int(self.ListOfDevices[item]["Battery"])
device["BatteryInside"] = True

elif item == "CheckParam":
Expand Down

0 comments on commit 50304da

Please sign in to comment.