2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-10 20:19:50 +00:00

98_weekprofile: create profiles in define and not only after INITIALIZED

git-svn-id: https://svn.fhem.de/fhem/trunk@10248 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
risiko79 2015-12-23 20:05:55 +00:00
parent d2e81429e6
commit 75bdb8bd18

View File

@ -67,6 +67,7 @@ sub weekprofile_getDeviceType($)
# determine device type
my $devHash = $main::defs{$device};
return undef unless (!defined($devHash));
my $type = undef;
@ -331,6 +332,10 @@ sub weekprofile_Define($$)
my @profiles = ();
$hash->{PROFILES} = \@profiles;
weekprofile_assignDev($hash);
weekprofile_readProfilesFromFile($hash);
weekprofile_updateReadings($hash);
#$attr{$me}{verbose} = 5;
return undef;
}
@ -533,6 +538,7 @@ sub weekprofile_Notify($$)
my ($what,$who) = split(' ',$s);
if ($what =~ m/INITIALIZED/) {
splice($own->{PROFILES});
Log3 $me, 5, "$me(Notify): assign to device $own->{MASTERDEV}->{NAME}" if (defined($own->{MASTERDEV}->{NAME}));
weekprofile_assignDev($own);
weekprofile_readProfilesFromFile($own);
@ -636,7 +642,8 @@ sub weekprofile_SummaryFn()
$lnk = "<a name=\"$d.detail\" href=\"$FW_ME$FW_subdir?detail=$d\">$lnk</a>" if($show_links);
my $args = "weekprofile";
my $curr = $hash->{PROFILES}[0]->{NAME};
my $curr = undef;
$curr = $hash->{PROFILES}[0]->{NAME} if (@{$hash->{PROFILES}} > 0 );
$html .= "<table>";
$html .= "<tr><td>";