dev #25

Merged
marko merged 10 commits from dev into main 2021-12-17 11:18:11 +00:00
4 changed files with 21 additions and 32 deletions
Showing only changes of commit 168c29f444 - Show all commits

View File

@ -1,4 +1,4 @@
UPD 2021-12-10_20:21:10 9332 FHEM/73_NUKIBridge.pm UPD 2021-12-10_20:47:57 9332 FHEM/73_NUKIBridge.pm
UPD 2021-12-10_20:22:28 7681 FHEM/74_NUKIDevice.pm UPD 2021-12-10_20:47:57 7681 FHEM/74_NUKIDevice.pm
UPD 2021-12-10_19:44:48 42801 lib/FHEM/Devices/Nuki/Bridge.pm UPD 2021-12-10_21:46:37 42734 lib/FHEM/Devices/Nuki/Bridge.pm
UPD 2021-12-10_20:17:22 16247 lib/FHEM/Devices/Nuki/Device.pm UPD 2021-12-10_21:57:25 16311 lib/FHEM/Devices/Nuki/Device.pm

View File

@ -4,25 +4,13 @@ use File::Basename;
use POSIX qw(strftime); use POSIX qw(strftime);
use strict; use strict;
my @filenames = ( 'FHEM/73_AutoShuttersControl.pm', my @filenames = ( 'FHEM/73_NUKIBridge.pm',
'lib/FHEM/Automation/ShuttersControl.pm', 'FHEM/74_NUKIDevice.pm',
'lib/FHEM/Automation/ShuttersControl/Dev.pm', 'lib/FHEM/Devices/Nuki/Bridge.pm',
'lib/FHEM/Automation/ShuttersControl/Roommate.pm', 'lib/FHEM/Devices/Nuki/Device.pm'
'lib/FHEM/Automation/ShuttersControl/Shutters.pm',
'lib/FHEM/Automation/ShuttersControl/Shading.pm',
'lib/FHEM/Automation/ShuttersControl/EventProcessingFunctions.pm',
'lib/FHEM/Automation/ShuttersControl/Helper.pm',
'lib/FHEM/Automation/ShuttersControl/Window.pm',
'lib/FHEM/Automation/ShuttersControl/Dev/Attr.pm',
'lib/FHEM/Automation/ShuttersControl/Dev/Readings.pm',
'lib/FHEM/Automation/ShuttersControl/Shutters/Attr.pm',
'lib/FHEM/Automation/ShuttersControl/Shutters/Readings.pm',
'lib/FHEM/Automation/ShuttersControl/Window/Attr.pm',
'lib/FHEM/Automation/ShuttersControl/Window/Readings.pm',
'lib/FHEM/Automation/ShuttersControl/Rainprotection.pm'
); );
my $controlsfile = 'controls_AutoShuttersControl.txt'; my $controlsfile = 'controls_NukiSmart.txt';
open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!"); open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");

View File

@ -426,27 +426,27 @@ sub Set {
given ($cmd) { given ($cmd) {
when ('getdevicelist') { when ('getdevicelist') {
return 'usage: getDeviceList' if ( defined($arg) ); return 'usage: getDeviceList' if ($arg);
$endpoint = 'list'; $endpoint = 'list';
} }
when ('info') { when ('info') {
return 'usage: info' if ( defined($arg) ); return 'usage: info' if ($arg);
$endpoint = 'info'; $endpoint = 'info';
} }
when ('fwupdate') { when ('fwupdate') {
return 'usage: fwUpdate' if ( defined($arg) ); return 'usage: fwUpdate' if ($arg);
$endpoint = 'fwupdate'; $endpoint = 'fwupdate';
} }
when ('reboot') { when ('reboot') {
return 'usage: freboot' if ( defined($arg) ); return 'usage: freboot' if ($arg);
$endpoint = 'reboot'; $endpoint = 'reboot';
} }
when ('clearlog') { when ('clearlog') {
return 'usage: clearLog' if ( defined($arg) ); return 'usage: clearLog' if ($arg);
$endpoint = 'clearlog'; $endpoint = 'clearlog';
} }
when ('factoryreset') { when ('factoryreset') {
return 'usage: factoryReset' if ( defined($arg) ); return 'usage: factoryReset' if ($arg);
$endpoint = 'factoryreset'; $endpoint = 'factoryreset';
} }
@ -1037,7 +1037,7 @@ sub CGI() {
$hash->{WEBHOOK_LAST} = ::TimeNow(); $hash->{WEBHOOK_LAST} = ::TimeNow();
::Log3( $name, 3, ::Log3( $name, 3,
"NUKIBridge WEBHOOK ($name) - Received webhook for matching NukiId at device $name" "NUKIBridge WEBHOOK ($name) - Received webhook for matching NukiId at IODev $name"
); );
::Dispatch( $hash, $json, undef ); ::Dispatch( $hash, $json, undef );

View File

@ -191,6 +191,7 @@ my %doorsensorStates = (
sub Define { sub Define {
my $hash = shift; my $hash = shift;
my $def = shift // return; my $def = shift // return;
my $version;
return $@ unless ( FHEM::Meta::SetInternals($hash) ); return $@ unless ( FHEM::Meta::SetInternals($hash) );
@ -455,8 +456,8 @@ sub Parse {
return $dhash->{NAME}; return $dhash->{NAME};
} }
else { else {
::Log3( $dname, 4, ::Log3( $name, 4,
"NUKIDevice ($dname) - autocreate new device " "NUKIDevice ($name) - autocreate new device "
. ::makeDeviceName( $decode_json->{name} ) . ::makeDeviceName( $decode_json->{name} )
. " with nukiId $decode_json->{nukiId}, model $decode_json->{deviceType}" . " with nukiId $decode_json->{nukiId}, model $decode_json->{deviceType}"
); );
@ -521,7 +522,7 @@ sub SmartlockState {
delete $hash->{helper}{lockAction}; delete $hash->{helper}{lockAction};
} }
return; return $decode_json;
} }
sub WriteReadings { sub WriteReadings {
@ -529,7 +530,7 @@ sub WriteReadings {
my $decode_json = shift; my $decode_json = shift;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
SmartlockState(); $decode_json = SmartlockState( $hash, $decode_json );
::readingsBeginUpdate($hash); ::readingsBeginUpdate($hash);