change define function

This commit is contained in:
Marko Oldenburg 2020-06-17 15:31:06 +02:00
parent 2bbe7e97f7
commit 3d029ab6f2
2 changed files with 10 additions and 5 deletions

View File

@ -1,2 +1,2 @@
UPD 2020-06-17_15:03:50 3368 FHEM/98_backupToStorage.pm UPD 2020-06-17_15:03:50 3368 FHEM/98_backupToStorage.pm
UPD 2020-06-17_15:20:54 10052 lib/FHEM/backupToStorage.pm UPD 2020-06-17_15:30:50 10123 lib/FHEM/backupToStorage.pm

View File

@ -80,10 +80,15 @@ sub Define {
$hash->{NOTIFYDEV} = 'global'; $hash->{NOTIFYDEV} = 'global';
readingsSingleUpdate( $hash, 'state', readingsSingleUpdate( $hash, 'state',
'please set storage account credentials first', 1 ) (
if ( AttrVal( $name, 'bTS_Host', 'none' ) eq 'none' (AttrVal( $name, 'bTS_Host', 'none' ) eq 'none'
|| AttrVal( $name, 'bTS_User', 'none' ) eq 'none' || AttrVal( $name, 'bTS_User', 'none' ) eq 'none'
|| !defined( ReadPassword( $hash, $name ) ) ); || !defined( ReadPassword( $hash, $name ) ) )
? 'please set storage account credentials first'
: 'ready'
)
, 1
);
Log3( $name, 3, "backupToStorage ($name) - defined" ); Log3( $name, 3, "backupToStorage ($name) - defined" );