mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 23:06:37 +00:00
MAX: Fix default values for min/maxTemperature
git-svn-id: https://svn.fhem.de/fhem/trunk@2730 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
dcca50859a
commit
7c8aa8240f
@ -39,8 +39,8 @@ sub validDecalcification { my ($decalcDay, $decalcHour) = ($_[0] =~ /^(...) (\d{
|
||||
sub validWeekProfile { return length($_[0]) == 4*13*7; }
|
||||
|
||||
my %readingDef = ( #min/max/default
|
||||
"maximumTemperature" => [ \&validTemperature, 30.5],
|
||||
"minimumTemperature" => [ \&validTemperature, 4.5],
|
||||
"maximumTemperature" => [ \&validTemperature, "on"],
|
||||
"minimumTemperature" => [ \&validTemperature, "off"],
|
||||
"comfortTemperature" => [ \&validTemperature, 21],
|
||||
"ecoTemperature" => [ \&validTemperature, 17],
|
||||
"windowOpenTemperature" => [ \&validTemperature, 12],
|
||||
@ -139,6 +139,7 @@ MAX_CheckIODev($)
|
||||
return !defined($hash->{IODev}) || ($hash->{IODev}{TYPE} ne "MAXLAN" && $hash->{IODev}{TYPE} ne "CUL_MAX");
|
||||
}
|
||||
|
||||
#Idenitify for numeric values and maps "on" and "off" to their temperatures
|
||||
sub
|
||||
MAX_ParseTemperature($)
|
||||
{
|
||||
@ -153,6 +154,8 @@ MAX_Validate(@)
|
||||
return $readingDef{$name}[0]->($val);
|
||||
}
|
||||
|
||||
#Get a reading, validating it's current value (maybe forcing to the default if invalid)
|
||||
#"on" and "off" are converted to their numeric values
|
||||
sub
|
||||
MAX_ReadingsVal(@)
|
||||
{
|
||||
@ -417,8 +420,7 @@ MAX_Set($@)
|
||||
my $temperature = $controlpoints[$j];
|
||||
return "Invalid time: $controlpoints[$j+1]" if(!defined($hour) || !defined($min) || $hour > 23 || $min > 59);
|
||||
return "Invalid temperature" if(!validTemperature($temperature));
|
||||
$temperature = 4.5 if($temperature eq "off");
|
||||
$temperature = 30.5 if($temperature eq "on");
|
||||
$temperature = MAX_ParseTemperature($temperature); #replace "on" and "off" by their values
|
||||
$newWeekprofilePart .= sprintf("%04x", (int($temperature*2) << 9) | int(($hour * 60 + $min)/5));
|
||||
}
|
||||
Log GetLogLevel($hash->{NAME}, 5), "New Temperature part for $day: $newWeekprofilePart";
|
||||
|
Loading…
x
Reference in New Issue
Block a user