add support for synology station

This commit is contained in:
Marko Oldenburg 2021-01-04 14:06:22 +01:00
parent 48758f31ab
commit 6c715e9b5d
3 changed files with 49 additions and 36 deletions

View File

@ -57,7 +57,7 @@ sub backupToStorage_Initialize {
. 'bTS_User '
. 'bTS_Path '
. 'bTS_Proto:http '
. 'bTS_Type:Nextcloud '
. 'bTS_Type:Nextcloud,SynologyFileStation '
. 'disable:1 '
. 'disabledForIntervals';
$hash->{parseParams} = 1;

View File

@ -1,2 +1,2 @@
UPD 2020-11-06_14:06:34 6242 FHEM/98_backupToStorage.pm
UPD 2020-11-09_08:14:35 18938 lib/FHEM/backupToStorage.pm
UPD 2020-11-09_13:01:44 6262 FHEM/98_backupToStorage.pm
UPD 2020-11-09_13:35:28 19356 lib/FHEM/backupToStorage.pm

View File

@ -358,6 +358,12 @@ sub Attr {
InternalTimer( gettimeofday() + 1,
'FHEM::backupToStorage::_CheckIsDisabledAfterSetAttr', $hash, 0 );
}
elsif ( $attrName eq 'bTS_Type' ) {
InternalTimer( gettimeofday() + 1,
sub { $hash->{STORAGETYPE} = AttrVal($name,'bTS_Type','Nextcloud'); }, $hash, 0 );
}
return;
}
sub _CheckIsDisabledAfterSetAttr {
@ -399,6 +405,11 @@ sub PushToStorage {
Log3( $name, 4, qq{backupToStorage ($name) - after readings age return} );
if ( $hash->{STORAGETYPE} eq 'SynologyFileStation' ) {
}
else {
require "SubProcess.pm";
my $subprocess = SubProcess->new( { onRun => \&FileUpload } );
@ -441,6 +452,8 @@ sub PushToStorage {
InternalTimer( gettimeofday() + 1,
"FHEM::backupToStorage::PollChild", $hash );
}
Log3( $hash, 4,
qq{backupToStorage ($name) - control passed back to main loop.} );