mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 20:06:18 +00:00
98_weekprofile: fix tempOff > tempOn
git-svn-id: https://svn.fhem.de/fhem/trunk@15803 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
e0a5e88f1a
commit
7d1021977c
@ -445,14 +445,15 @@ sub weekprofile_assignDev($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!defined($prf)) {
|
if (!defined($prf)) {
|
||||||
|
Log3 $me, 5, "create default profile";
|
||||||
my $prfDev = weekprofile_createDefaultProfile($hash);
|
my $prfDev = weekprofile_createDefaultProfile($hash);
|
||||||
if(defined($prfDev)) {
|
if(defined($prfDev)) {
|
||||||
$prf = {};
|
$prf = {};
|
||||||
$prf->{DATA} = $prfDev;
|
$prf->{DATA} = $prfDev;
|
||||||
$prf->{NAME} = 'default';
|
$prf->{NAME} = 'default';
|
||||||
$prf->{TOPIC} = 'default';
|
$prf->{TOPIC} = 'default';
|
||||||
|
$hash->{STATE} = "created";
|
||||||
}
|
}
|
||||||
$hash->{STATE} = "created";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(defined($prf)) {
|
if(defined($prf)) {
|
||||||
@ -1017,6 +1018,22 @@ sub weekprofile_Attr($$$)
|
|||||||
|
|
||||||
$attr{$me}{$attrName} = $attrVal;
|
$attr{$me}{$attrName} = $attrVal;
|
||||||
weekprofile_writeProfilesToFile($hash) if ($attrName eq 'configFile');
|
weekprofile_writeProfilesToFile($hash) if ($attrName eq 'configFile');
|
||||||
|
|
||||||
|
if ($attrName eq 'tempON') {
|
||||||
|
my $tempOFF = AttrVal($me, "tempOFF", $attrVal);
|
||||||
|
if ($tempOFF > $attrVal) {
|
||||||
|
Log3 $me, 2, "$me(weekprofile_Attr): warning: tempON must be bigger than tempOFF";
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($attrName eq 'tempOFF') {
|
||||||
|
my $tempON = AttrVal($me, "tempON", $attrVal);
|
||||||
|
if ($tempON < $attrVal) {
|
||||||
|
Log3 $me, 2, "$me(weekprofile_Attr): warning: tempOFF must be smaller than tempON";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1026,6 +1043,11 @@ sub weekprofile_writeProfilesToFile(@)
|
|||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
my $me = $hash->{NAME};
|
my $me = $hash->{NAME};
|
||||||
|
|
||||||
|
if (!defined($hash->{PROFILES})) {
|
||||||
|
Log3 $me, 4, "$me(writeProfileToFile): no pofiles to save";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
my $start = (defined($hash->{MASTERDEV})) ? 1:0;
|
my $start = (defined($hash->{MASTERDEV})) ? 1:0;
|
||||||
my $prfCnt = scalar(@{$hash->{PROFILES}});
|
my $prfCnt = scalar(@{$hash->{PROFILES}});
|
||||||
return if ($prfCnt <= $start);
|
return if ($prfCnt <= $start);
|
||||||
|
@ -573,6 +573,13 @@ function FW_weekprofileEditDay(widget,day)
|
|||||||
if (tempOff == null)
|
if (tempOff == null)
|
||||||
tempOff = 5;
|
tempOff = 5;
|
||||||
|
|
||||||
|
if (tempOff > tempOn)
|
||||||
|
{
|
||||||
|
var tmp = tempOn;
|
||||||
|
tempOn = tempOff;
|
||||||
|
tempOff = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
html += "<td><select name=\"TEMP\" size=\"1\" onchange=\"FW_weekprofileTemp_chached(this)\">";
|
html += "<td><select name=\"TEMP\" size=\"1\" onchange=\"FW_weekprofileTemp_chached(this)\">";
|
||||||
for (var k=tempOff; k <= tempOn; k+=.5)
|
for (var k=tempOff; k <= tempOn; k+=.5)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user