From ae57a242591c9de3df09efd736f68d466eed0e3c Mon Sep 17 00:00:00 2001
From: jkerdreu <jkerdreu@b32b6428-25c9-4566-ad07-03861ab6144f>
Date: Thu, 15 Dec 2022 21:08:37 +0000
Subject: [PATCH] Fix percent to integers

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/0.7@3055 b32b6428-25c9-4566-ad07-03861ab6144f
---
 devices/protocols/Aqara/xaal/aqara/devices.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/devices/protocols/Aqara/xaal/aqara/devices.py b/devices/protocols/Aqara/xaal/aqara/devices.py
index 99e7ba01..6b9caebe 100644
--- a/devices/protocols/Aqara/xaal/aqara/devices.py
+++ b/devices/protocols/Aqara/xaal/aqara/devices.py
@@ -112,7 +112,7 @@ class AqaraDev(object):
             voltage = min(voltage, max_volt)
             voltage = max(voltage, min_volt)
             percent = ((voltage - min_volt) / (max_volt - min_volt)) * 100
-            self.battery.attributes['level'] = percent
+            self.battery.attributes['level'] = int(percent)
 
     def on_report(self, data):
         logger.info('Unhandled report %s' % data)
-- 
GitLab