From 50304da98e27f72b96c6e9af0b6d9d00d13a6349 Mon Sep 17 00:00:00 2001 From: Pipiche <8291674+pipiche38@users.noreply.github.com> Date: Sat, 11 Jan 2025 18:09:07 +0100 Subject: [PATCH] Accept "Battery" to be an int but also a float --- Classes/WebServer/WebServer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/WebServer/WebServer.py b/Classes/WebServer/WebServer.py index 5a047eb79..51687543b 100644 --- a/Classes/WebServer/WebServer.py +++ b/Classes/WebServer/WebServer.py @@ -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":