remove alive counter
This commit is contained in:
parent
8e393b1bd1
commit
8f1b164dd0
@ -235,7 +235,6 @@ sub Define($$) {
|
|||||||
$hash->{NOTIFYDEV} = 'global,' . $name;
|
$hash->{NOTIFYDEV} = 'global,' . $name;
|
||||||
$hash->{VERSION} = version->parse($VERSION)->normal;
|
$hash->{VERSION} = version->parse($VERSION)->normal;
|
||||||
$hash->{BRIDGEAPI} = FHEM::Meta::Get( $hash, 'x_apiversion' );
|
$hash->{BRIDGEAPI} = FHEM::Meta::Get( $hash, 'x_apiversion' );
|
||||||
$hash->{helper}->{aliveCount} = 0;
|
|
||||||
$hash->{helper}->{actionQueue} = [];
|
$hash->{helper}->{actionQueue} = [];
|
||||||
$hash->{helper}->{iowrite} = 0;
|
$hash->{helper}->{iowrite} = 0;
|
||||||
my $infix = 'NUKIBridge';
|
my $infix = 'NUKIBridge';
|
||||||
@ -397,10 +396,14 @@ sub Notify($$) {
|
|||||||
FirstRun($hash)
|
FirstRun($hash)
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
grep /^INITIALIZED$/, @{$events}
|
grep /^INITIALIZED$/,
|
||||||
or grep /^REREADCFG$/, @{$events}
|
@{$events}
|
||||||
or grep /^MODIFIED.$name$/, @{$events}
|
or grep /^REREADCFG$/,
|
||||||
or grep /^DEFINED.$name$/, @{$events}
|
@{$events}
|
||||||
|
or grep /^MODIFIED.$name$/,
|
||||||
|
@{$events}
|
||||||
|
or grep /^DEFINED.$name$/,
|
||||||
|
@{$events}
|
||||||
)
|
)
|
||||||
and $devname eq 'global'
|
and $devname eq 'global'
|
||||||
and $init_done
|
and $init_done
|
||||||
@ -573,10 +576,11 @@ sub Write($@) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$hash->{helper}->{lastDeviceAction} = $obj
|
$hash->{helper}->{lastDeviceAction} = $obj
|
||||||
if ( ( defined($param)
|
if (
|
||||||
and $param)
|
( defined($param) and $param )
|
||||||
or (defined($nukiId)
|
or ( defined($nukiId)
|
||||||
and $nukiId) );
|
and $nukiId )
|
||||||
|
);
|
||||||
|
|
||||||
unshift( @{ $hash->{helper}->{actionQueue} }, $obj );
|
unshift( @{ $hash->{helper}->{actionQueue} }, $obj );
|
||||||
|
|
||||||
@ -703,9 +707,7 @@ sub Distribution($$$) {
|
|||||||
if ( $err ne '' ) {
|
if ( $err ne '' ) {
|
||||||
if ( $param->{endpoint} eq 'info' ) {
|
if ( $param->{endpoint} eq 'info' ) {
|
||||||
readingsBulkUpdate( $hash, 'state', 'not connected' );
|
readingsBulkUpdate( $hash, 'state', 'not connected' );
|
||||||
# if ( $hash->{helper}{aliveCount} > 1 );
|
|
||||||
Log3( $name, 5, "NUKIBridge ($name) - Bridge ist offline" );
|
Log3( $name, 5, "NUKIBridge ($name) - Bridge ist offline" );
|
||||||
# $hash->{helper}{aliveCount} = $hash->{helper}{aliveCount} + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
readingsBulkUpdate( $hash, 'lastError', $err )
|
readingsBulkUpdate( $hash, 'lastError', $err )
|
||||||
@ -909,8 +911,6 @@ sub ResponseProcessing($$$) {
|
|||||||
|
|
||||||
InfoProcessing( $hash, $decode_json )
|
InfoProcessing( $hash, $decode_json )
|
||||||
if ( $endpoint eq 'info' );
|
if ( $endpoint eq 'info' );
|
||||||
|
|
||||||
$hash->{helper}{aliveCount} = 0;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log3(
|
Log3(
|
||||||
@ -1336,7 +1336,7 @@ sub ParseJSON($$) {
|
|||||||
],
|
],
|
||||||
"release_status": "under develop",
|
"release_status": "under develop",
|
||||||
"license": "GPL_2",
|
"license": "GPL_2",
|
||||||
"version": "v1.9.13",
|
"version": "v1.9.14",
|
||||||
"x_apiversion": "1.9",
|
"x_apiversion": "1.9",
|
||||||
"author": [
|
"author": [
|
||||||
"Marko Oldenburg <leongaultier@gmail.com>"
|
"Marko Oldenburg <leongaultier@gmail.com>"
|
||||||
|
@ -30,7 +30,6 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
|
||||||
package FHEM::NUKIDevice;
|
package FHEM::NUKIDevice;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@ -291,7 +290,7 @@ sub Define($$) {
|
|||||||
$modules{NUKIDevice}{defptr}{$nukiId} = $hash;
|
$modules{NUKIDevice}{defptr}{$nukiId} = $hash;
|
||||||
|
|
||||||
GetUpdate($hash)
|
GetUpdate($hash)
|
||||||
if ( ReadingsVal($name,'success','none') eq 'none'
|
if ( ReadingsVal( $name, 'success', 'none' ) eq 'none'
|
||||||
and $init_done );
|
and $init_done );
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -363,10 +362,14 @@ sub Notify($$) {
|
|||||||
GetUpdate($hash)
|
GetUpdate($hash)
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
grep /^INITIALIZED$/, @{$events}
|
grep /^INITIALIZED$/,
|
||||||
or grep /^REREADCFG$/, @{$events}
|
@{$events}
|
||||||
or grep /^MODIFIED.$name$/, @{$events}
|
or grep /^REREADCFG$/,
|
||||||
or grep /^DEFINED.$name$/, @{$events}
|
@{$events}
|
||||||
|
or grep /^MODIFIED.$name$/,
|
||||||
|
@{$events}
|
||||||
|
or grep /^DEFINED.$name$/,
|
||||||
|
@{$events}
|
||||||
)
|
)
|
||||||
and $devname eq 'global'
|
and $devname eq 'global'
|
||||||
and $init_done
|
and $init_done
|
||||||
@ -430,7 +433,8 @@ sub GetUpdate($) {
|
|||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
if ( !IsDisabled($name) ) {
|
if ( !IsDisabled($name) ) {
|
||||||
IOWrite( $hash, 'lockState', undef, $hash->{NUKIID}, $hash->{DEVICETYPE} );
|
IOWrite( $hash, 'lockState', undef, $hash->{NUKIID},
|
||||||
|
$hash->{DEVICETYPE} );
|
||||||
Log3( $name, 2, "NUKIDevice ($name) - GetUpdate Call IOWrite" );
|
Log3( $name, 2, "NUKIDevice ($name) - GetUpdate Call IOWrite" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user