Version 2.0 Pre-Release #20

Merged
marko merged 29 commits from devel into main 2021-12-05 11:25:38 +00:00
3 changed files with 31 additions and 6 deletions
Showing only changes of commit efbea2f987 - Show all commits

View File

@ -1,4 +1,4 @@
UPD 2021-11-27_21:36:20 9217 FHEM/73_NUKIBridge.pm
UPD 2021-11-27_22:52:03 9217 FHEM/73_NUKIBridge.pm
UPD 2021-11-27_21:36:27 7569 FHEM/74_NUKIDevice.pm
UPD 2021-11-27_21:36:20 40112 lib/FHEM/Devices/Nuki/Bridge.pm
UPD 2021-11-27_21:36:59 15467 lib/FHEM/Devices/Nuki/Device.pm
UPD 2021-11-27_22:52:20 40367 lib/FHEM/Devices/Nuki/Bridge.pm
UPD 2021-11-27_22:56:00 15826 lib/FHEM/Devices/Nuki/Device.pm

View File

@ -501,7 +501,14 @@ sub GetCheckBridgeAlive {
if ( !::IsDisabled($name)
&& $hash->{helper}->{iowrite} == 0 )
{
if ( $hash->{helper}->{runInfo} == 0 ) {
Write( $hash, 'info', undef );
$hash->{helper}->{runInfo} = 1;
}
else {
Write( $hash, 'list', undef );
$hash->{helper}->{runInfo} = 0;
}
::Log3( $name, 4, "NUKIBridge ($name) - run Write" );
}
@ -521,6 +528,7 @@ sub FirstRun {
Write( $hash, 'list', undef )
if ( !::IsDisabled($name) );
$hash->{helper}->{runInfo} = 0;
return ::InternalTimer( ::gettimeofday() + 5,
\&FHEM::Devices::Nuki::Bridge::GetCheckBridgeAlive, $hash );
}

View File

@ -111,6 +111,9 @@ my %deviceTypes = (
4 => 'smartlock3'
);
my %deviceTypeIds = reverse(%deviceTypes);
my %modes = (
2 => {
0 => 'door mode',
@ -180,7 +183,14 @@ my %lockStates = (
}
);
my %deviceTypeIds = reverse(%deviceTypes);
my %doorsensorStates = (
1 => 'deactivated',
2 => 'door closed',
3 => 'door opened',
4 => 'door state unknown',
5 => 'calibrating'
);
sub Define {
my $hash = shift;
@ -205,6 +215,7 @@ sub Define {
$hash->{STATE} = 'Initialized';
$hash->{NOTIFYDEV} = 'global,autocreate,' . $name;
my $iodev = ::AttrVal( $name, 'IODev', 'none' );
::AssignIoPort( $hash, $iodev ) if ( !$hash->{IODev} );
@ -543,7 +554,10 @@ sub WriteReadings {
&& $t ne 'batteryCritical'
&& $t ne 'batteryChargeState'
&& $t ne 'batteryCharging'
&& $t ne 'timestamp' );
&& $t ne 'timestamp'
&& $t ne 'doorsensorState'
&& $t ne 'doorsensorStateName' );
::readingsBulkUpdate(
$hash, $t,
@ -560,6 +574,9 @@ sub WriteReadings {
::readingsBulkUpdate( $hash, $t, $deviceTypes{$v} )
if ( $t eq 'deviceType' );
::readingsBulkUpdate( $hash, $t, $doorsensorStates{$v} )
if ( $t eq 'doorsensorState' );
::readingsBulkUpdate( $hash, $t, ( $v == 1 ? 'true' : 'false' ) )
if ( $t eq 'paired' );