fix Problem with Battery State
This commit is contained in:
parent
4177be6a1a
commit
7b14b5ce97
@ -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";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user