diff --git a/controls_backupToStorage.txt b/controls_backupToStorage.txt index ccce939..ae4a9f0 100644 --- a/controls_backupToStorage.txt +++ b/controls_backupToStorage.txt @@ -1,2 +1,2 @@ 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 diff --git a/lib/FHEM/backupToStorage.pm b/lib/FHEM/backupToStorage.pm index e46389c..cab4666 100644 --- a/lib/FHEM/backupToStorage.pm +++ b/lib/FHEM/backupToStorage.pm @@ -80,10 +80,15 @@ sub Define { $hash->{NOTIFYDEV} = 'global'; readingsSingleUpdate( $hash, 'state', - 'please set storage account credentials first', 1 ) - if ( AttrVal( $name, 'bTS_Host', 'none' ) eq 'none' - || AttrVal( $name, 'bTS_User', 'none' ) eq 'none' - || !defined( ReadPassword( $hash, $name ) ) ); + ( + (AttrVal( $name, 'bTS_Host', 'none' ) eq 'none' + || AttrVal( $name, 'bTS_User', 'none' ) eq 'none' + || !defined( ReadPassword( $hash, $name ) ) ) + ? 'please set storage account credentials first' + : 'ready' + ) + , 1 + ); Log3( $name, 3, "backupToStorage ($name) - defined" );