fix critical error

This commit is contained in:
2021-12-10 21:59:48 +01:00
parent ca58793d03
commit 168c29f444
4 changed files with 21 additions and 32 deletions

View File

@ -426,27 +426,27 @@ sub Set {
given ($cmd) {
when ('getdevicelist') {
return 'usage: getDeviceList' if ( defined($arg) );
return 'usage: getDeviceList' if ($arg);
$endpoint = 'list';
}
when ('info') {
return 'usage: info' if ( defined($arg) );
return 'usage: info' if ($arg);
$endpoint = 'info';
}
when ('fwupdate') {
return 'usage: fwUpdate' if ( defined($arg) );
return 'usage: fwUpdate' if ($arg);
$endpoint = 'fwupdate';
}
when ('reboot') {
return 'usage: freboot' if ( defined($arg) );
return 'usage: freboot' if ($arg);
$endpoint = 'reboot';
}
when ('clearlog') {
return 'usage: clearLog' if ( defined($arg) );
return 'usage: clearLog' if ($arg);
$endpoint = 'clearlog';
}
when ('factoryreset') {
return 'usage: factoryReset' if ( defined($arg) );
return 'usage: factoryReset' if ($arg);
$endpoint = 'factoryreset';
}
@ -1037,7 +1037,7 @@ sub CGI() {
$hash->{WEBHOOK_LAST} = ::TimeNow();
::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 );

View File

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