From 7b14b5ce9741b63dcb71bed336894d02a37704f5 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Wed, 21 Dec 2016 11:24:16 +0100 Subject: [PATCH] fix Problem with Battery State --- 74_NUKIDevice.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/74_NUKIDevice.pm b/74_NUKIDevice.pm index 7708dd6..a9701ce 100644 --- a/74_NUKIDevice.pm +++ b/74_NUKIDevice.pm @@ -33,7 +33,7 @@ use warnings; use JSON; #use Time::HiRes qw(gettimeofday); -my $version = "0.4.0"; +my $version = "0.4.1"; @@ -402,9 +402,9 @@ sub NUKIDevice_WriteReadings($$) { my $battery; if( defined($decode_json->{batteryCritical}) ) { - if( $decode_json->{batteryCritical} eq "false" ) { + if( $decode_json->{batteryCritical} eq "false" or $decode_json->{batteryCritical} == 0 ) { $battery = "ok"; - } elsif ( $decode_json->{batteryCritical} eq "true" ) { + } elsif ( $decode_json->{batteryCritical} eq "true" or $decode_json->{batteryCritical} == 1 ) { $battery = "low"; } else { $battery = "parseError";