diff --git a/fhem/CHANGED b/fhem/CHANGED index 7dc31fcf1..2064f6411 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - feature: 98_weekprofile: supporting dbconfig migrate - change: 70_DENON_AVR: even more surround-modes (thx Shadow3561) - new: 57_SSCal: new module for Synology Calendar App (API) - feature: Add new AttrTemplate file for speech recognition diff --git a/fhem/FHEM/98_weekprofile.pm b/fhem/FHEM/98_weekprofile.pm index 8659e723d..0fe6bf170 100644 --- a/fhem/FHEM/98_weekprofile.pm +++ b/fhem/FHEM/98_weekprofile.pm @@ -1356,12 +1356,13 @@ sub weekprofile_writeProfilesToFile(@) push (@content, "entry=".$json->encode($hash->{PROFILES}[$i])); } - my $filename = weekprofile_getDataFile($me); - Log3 $me, 5, "$me(writeProfileToFile): write profiles to $filename"; + my $dbused = configDBUsed(); + my $filename = weekprofile_getDataFile($hash); + Log3 $me, 5, "$me(writeProfileToFile): write profiles to $filename [DB: $dbused]"; my $ret = FileWrite($filename,@content); if ($ret){ - Log3 $me, 1, "$me(writeProfileToFile): write profiles to $filename failed $ret"; + Log3 $me, 1, "$me(writeProfileToFile): write profiles to $filename [DB: $dbused] failed $ret"; } else { DoTrigger($me,"PROFILES_SAVED",1); weekprofile_updateReadings($hash); @@ -1370,7 +1371,8 @@ sub weekprofile_writeProfilesToFile(@) ############################################## sub weekprofile_getDataFile(@) { - my ($me) = @_; + my ($hash) = @_; + my $me = $hash->{NAME}; my $filename = "%L/weekprofile-$me.cfg"; $filename = AttrVal($me,"configFile",$filename); my @t = localtime(gettimeofday()); @@ -1378,6 +1380,7 @@ sub weekprofile_getDataFile(@) # compatibility to old weekprofile versions # if no global logdir is set - use log $filename =~s/%L/.\/log/g; + $hash->{CONFIGFILE} = $filename; # for configDB migration return $filename; } ############################################## @@ -1388,7 +1391,7 @@ sub weekprofile_readProfilesFromFile(@) my $useTopics = AttrVal($me,"useTopics",0); - my $filename = weekprofile_getDataFile($me); + my $filename = weekprofile_getDataFile($hash); Log3 $me, 5, "$me(readProfilesFromFile): read profiles from $filename"; my ($ret, @content) = FileRead($filename); @@ -1626,6 +1629,8 @@ sub weekprofile_getEditLNK_MasterDev($$) With 'restore_topic' the defined profile in the attribute will be transfered to the thermostat. So it is possible to change the topic easily and all thermostats will be updated with the correndponding profile.

+ Weekprofile is supports configdb and configdb migrate since svn: 21314 +

Attention: To transfer a profile to a device it needs a lot of Credits. This is not taken into account from this module. So it could be happend that the profile in the module