74_NUKIDevice: Fix Problem with battery Reading

git-svn-id: https://svn.fhem.de/fhem/trunk@12856 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
CoolTux
2016-12-21 10:26:13 +00:00
parent 7609885a88
commit 20f7db95c8
2 changed files with 4 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it. # Do not insert empty lines here, update check depends on it.
- bugfix: 74_NUKIDevice: Fix Problem with battery Reading
- update: 97_TrashCal.pm: fetches shared dates at an public webpage - update: 97_TrashCal.pm: fetches shared dates at an public webpage
of waste disposal of waste disposal
- bugfix: 73_GasCalculator: Corrected month of annual reading - bugfix: 73_GasCalculator: Corrected month of annual reading

View File

@@ -33,7 +33,7 @@ use warnings;
use JSON; use JSON;
#use Time::HiRes qw(gettimeofday); #use Time::HiRes qw(gettimeofday);
my $version = "0.4.0"; my $version = "0.4.1";
@@ -402,9 +402,9 @@ sub NUKIDevice_WriteReadings($$) {
my $battery; my $battery;
if( defined($decode_json->{batteryCritical}) ) { if( defined($decode_json->{batteryCritical}) ) {
if( $decode_json->{batteryCritical} eq "false" ) { if( $decode_json->{batteryCritical} eq "false" or $decode_json->{batteryCritical} == 0 ) {
$battery = "ok"; $battery = "ok";
} elsif ( $decode_json->{batteryCritical} eq "true" ) { } elsif ( $decode_json->{batteryCritical} eq "true" or $decode_json->{batteryCritical} == 1 ) {
$battery = "low"; $battery = "low";
} else { } else {
$battery = "parseError"; $battery = "parseError";