From 79174ce0cef58f5fbe020c404a3d0dcceec8decb Mon Sep 17 00:00:00 2001 From: GingerSnap-xx Date: Wed, 1 May 2024 20:26:45 +0000 Subject: [PATCH 1/2] Make AC motor check more region agnostic --- motionblinds/motion_blinds.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/motionblinds/motion_blinds.py b/motionblinds/motion_blinds.py index 75f2b1b..1d18148 100644 --- a/motionblinds/motion_blinds.py +++ b/motionblinds/motion_blinds.py @@ -1051,8 +1051,11 @@ def _calculate_battery_level(self, voltage): # 4 cel battery pack (16.8V) return round((voltage - 14.6) * 100 / (16.8 - 14.6), 0) - if voltage == 220.0: + if voltage >= 100.0: # AC motor + #There are a myriad of residential mains voltages, + # but all of them seem to be over 100. + #https://en.wikipedia.org/wiki/Mains_electricity_by_country return None if voltage <= 0.0: From b023f269cc27227b40e2f99f3b4c158972c515f1 Mon Sep 17 00:00:00 2001 From: starkillerOG Date: Sat, 22 Jun 2024 16:34:32 +0200 Subject: [PATCH 2/2] Update motionblinds/motion_blinds.py --- motionblinds/motion_blinds.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/motionblinds/motion_blinds.py b/motionblinds/motion_blinds.py index 1d18148..74af1f9 100644 --- a/motionblinds/motion_blinds.py +++ b/motionblinds/motion_blinds.py @@ -1053,9 +1053,6 @@ def _calculate_battery_level(self, voltage): if voltage >= 100.0: # AC motor - #There are a myriad of residential mains voltages, - # but all of them seem to be over 100. - #https://en.wikipedia.org/wiki/Mains_electricity_by_country return None if voltage <= 0.0: