2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

98_WeekdayTimer.pm: bugfix in weekprofile handling, #112058

git-svn-id: https://svn.fhem.de/fhem/trunk@22183 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2020-06-15 05:52:27 +00:00
parent ae49ff7f06
commit 13bfd4d0a9

View File

@ -187,7 +187,7 @@ sub WeekdayTimer_Set {
}
return;
}
if ($v =~ /weekprofile ([^: ]+):([^:]+):([^: ]+)\b/x) {
if ($v =~ m/\Aweekprofile[ ]([^: ]+):([^:]+):([^: ]+)\b/x) {
Log3( $hash, 3, "[$name] set $name $v" );
return unless WeekdayTimer_UpdateWeekprofileReading($hash, $1, $2, $3);
WeekdayTimer_DeleteTimer($hash);
@ -1325,7 +1325,7 @@ sub WeekdayTimer_SetAllParms { # {WeekdayTimer_SetAllParms()}
sub WeekdayTimer_UpdateWeekprofileReading {
my ($hash,$wp_name,$wp_topic,$wp_profile) = @_;
my $name = $hash->{NAME};
unless (defined $defs{$wp_name} && InternalVal($wp_name,"TYPE","false") eq "weekprofile") {
if (!defined $defs{$wp_name} || InternalVal($wp_name,"TYPE","false") ne "weekprofile") {
Log3( $hash, 3, "[$name] weekprofile $wp_name not accepted, device seems not to exist or not to be of TYPE weekprofile" );
return;
}
@ -1339,7 +1339,7 @@ sub WeekdayTimer_UpdateWeekprofileReading {
my $newtriplett = qq($wp_name:$wp_topic:$wp_profile);
push @newt ,$newtriplett;
for my $triplett (@t){
push @newt ,$triplett unless $triplett =~ m{$wp_name\b}xms;
push @newt ,$triplett unless $triplett =~ m{\A$wp_name\b}xms;
}
readingsSingleUpdate ($hash, "weekprofiles", join(" ",@newt), 1);
return 1;