fix typo
This commit is contained in:
parent
2692c1bceb
commit
6d01e89d5b
@ -1,2 +1,2 @@
|
||||
UPD 2020-11-06_14:06:34 6242 FHEM/98_backupToStorage.pm
|
||||
UPD 2020-11-09_07:59:46 19033 lib/FHEM/backupToStorage.pm
|
||||
UPD 2020-11-09_08:07:09 18936 lib/FHEM/backupToStorage.pm
|
||||
|
@ -161,7 +161,7 @@ sub Define {
|
||||
$hash->{NOTIFYDEV} = 'global,' . $name;
|
||||
$hash->{STORAGETYPE} = AttrVal( $name, 'bTS_Type', 'Nextcloud' );
|
||||
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - defined} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - defined} );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -170,7 +170,7 @@ sub Undef {
|
||||
my $hash = shift;
|
||||
my $name = shift;
|
||||
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - delete device $name} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - delete device $name} );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -223,12 +223,11 @@ sub Notify {
|
||||
|
||||
|
||||
Log3( $name, 4,
|
||||
qq{backupToStorage ("$name") - Devname:
|
||||
" $devname "
|
||||
Name:
|
||||
" $name "
|
||||
Notify:
|
||||
Dumper $events}); # mit Dumper
|
||||
qq{backupToStorage ($name) -
|
||||
Devname: $devname
|
||||
Name: $name
|
||||
Notify:Dumper $events}
|
||||
); # mit Dumper
|
||||
|
||||
PushToStorage($hash)
|
||||
if ( ( grep m{^backup.done(.+)?$}xms, @{$events} )
|
||||
@ -349,10 +348,10 @@ sub Attr {
|
||||
return
|
||||
'check disabledForIntervals Syntax HH:MM-HH:MM or HH:MM-HH:MM HH:MM-HH:MM ...'
|
||||
if ( $attrVal !~ /^((\d{2}:\d{2})-(\d{2}:\d{2})\s?)+$/ );
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - disabledForIntervals} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - disabledForIntervals} );
|
||||
}
|
||||
elsif ( $attrName eq 'disable' ) {
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - disabled} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - disabled} );
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,7 +368,7 @@ sub _CheckIsDisabledAfterSetAttr {
|
||||
? 'disabled'
|
||||
: 'ready' );
|
||||
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - _CheckIsDisabledAfterSetAttr} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - _CheckIsDisabledAfterSetAttr} );
|
||||
|
||||
readingsSingleUpdate($hash, 'state', $state, 1)
|
||||
if ( ReadingsVal($name, 'state', 'ready' ) ne $state );
|
||||
@ -392,12 +391,12 @@ sub PushToStorage {
|
||||
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
Log3( $name, 4, qq{backupToStorage ("$name") - push to storage function} );
|
||||
Log3( $name, 4, qq{backupToStorage ($name) - push to storage function} );
|
||||
|
||||
return
|
||||
if ( ReadingsAge($name,'fhemBackupFile',1) > 180 );
|
||||
|
||||
Log3( $name, 4, qq{backupToStorage ("$name") - after readings age return} );
|
||||
Log3( $name, 4, qq{backupToStorage ($name) - after readings age return} );
|
||||
|
||||
|
||||
require "SubProcess.pm";
|
||||
@ -426,7 +425,7 @@ sub PushToStorage {
|
||||
|
||||
if ( !defined($pid) ) {
|
||||
Log3( $name, 1,
|
||||
qq{backupToStorage ("$name") - Cannot execute command asynchronously} );
|
||||
qq{backupToStorage ($name) - Cannot execute command asynchronously} );
|
||||
|
||||
CleanSubprocess($hash);
|
||||
readingsSingleUpdate( $hash, 'state',
|
||||
@ -435,7 +434,7 @@ sub PushToStorage {
|
||||
}
|
||||
|
||||
Log3( $name, 4,
|
||||
qq{backupToStorage ("$name") - execute command asynchronously (PID="$pid")}
|
||||
qq{backupToStorage ($name) - execute command asynchronously (PID="$pid")}
|
||||
);
|
||||
|
||||
$hash->{".fhem"}{subprocess} = $subprocess;
|
||||
@ -443,7 +442,7 @@ sub PushToStorage {
|
||||
InternalTimer( gettimeofday() + 1,
|
||||
"FHEM::backupToStorage::PollChild", $hash );
|
||||
Log3( $hash, 4,
|
||||
qq{backupToStorage ("$name") - control passed back to main loop.} );
|
||||
qq{backupToStorage ($name) - control passed back to main loop.} );
|
||||
|
||||
return;
|
||||
}
|
||||
@ -459,20 +458,20 @@ sub PollChild {
|
||||
|
||||
if ( !defined($json) ) {
|
||||
Log3( $name, 5,
|
||||
qq{backupToStorage ($name) - still waiting (
|
||||
" $subprocess->{lasterror} "
|
||||
).} );
|
||||
qq{backupToStorage ($name) - still waiting ($subprocess->{lasterror} ").}
|
||||
);
|
||||
|
||||
InternalTimer( gettimeofday() + 1,
|
||||
"FHEM::backupToStorage::PollChild", $hash );
|
||||
return;
|
||||
}
|
||||
else {
|
||||
Log3( $name, 4,
|
||||
qq{backupToStorage ("$name") - got result from asynchronous parsing: "
|
||||
. $json} );
|
||||
qq{backupToStorage ($name) - got result from asynchronous parsing: $json} );
|
||||
|
||||
$subprocess->wait();
|
||||
Log3( $name, 4,
|
||||
qq{backupToStorage ("$name") - asynchronous finished.} );
|
||||
qq{backupToStorage ($name) - asynchronous finished.} );
|
||||
|
||||
CleanSubprocess($hash);
|
||||
WriteReadings( $hash, $json );
|
||||
@ -558,7 +557,7 @@ sub CleanSubprocess {
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
delete( $hash->{".fhem"}{subprocess} );
|
||||
Log3( $name, 4, qq{backupToStorage ("$name") - clean Subprocess} );
|
||||
Log3( $name, 4, qq{backupToStorage ($name) - clean Subprocess} );
|
||||
}
|
||||
|
||||
sub StorePassword {
|
||||
@ -599,14 +598,14 @@ sub ReadPassword {
|
||||
my $key = getUniqueId() . $index;
|
||||
my ( $password, $err );
|
||||
|
||||
Log3( $name, 4, qq{backupToStorage ("$name") - Read password from file} );
|
||||
Log3( $name, 4, qq{backupToStorage ($name) - Read password from file} );
|
||||
|
||||
( $err, $password ) = getKeyValue($index);
|
||||
|
||||
if ( defined($err) ) {
|
||||
|
||||
Log3( $name, 3,
|
||||
qq{backupToStorage ("$name") - unable to read password from file: $err}
|
||||
qq{backupToStorage ($name) - unable to read password from file: $err}
|
||||
);
|
||||
return undef;
|
||||
}
|
||||
@ -629,7 +628,7 @@ sub ReadPassword {
|
||||
return $dec_pwd;
|
||||
}
|
||||
else {
|
||||
Log3( $name, 3, qq{backupToStorage ("$name") - No password in file} );
|
||||
Log3( $name, 3, qq{backupToStorage ($name) - No password in file} );
|
||||
return undef;
|
||||
}
|
||||
|
||||
@ -680,7 +679,7 @@ sub WriteReadings {
|
||||
|
||||
my $decode_json = eval { decode_json($json) };
|
||||
if ($@) {
|
||||
Log3( $name, 2, qq{backupToStorage ("$name") - JSON error: $@} );
|
||||
Log3( $name, 2, qq{backupToStorage ($name) - JSON error: $@} );
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user