mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
desired-temp list moved from FHEMWEB to the source module.
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@1193 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ef09d15960
commit
c229e974a4
@ -1075,6 +1075,7 @@ CUL_HM_Set($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$hash->{STATE} = $state if($state);
|
$hash->{STATE} = $state if($state);
|
||||||
|
Log GetLogLevel($name,2), "CUL_HM set $name " . join(" ", @a[1..$#a]);
|
||||||
|
|
||||||
CUL_HM_ProcessCmdStack($hash) if(!$isSender);
|
CUL_HM_ProcessCmdStack($hash) if(!$isSender);
|
||||||
return "";
|
return "";
|
||||||
@ -1458,10 +1459,16 @@ CUL_HM_encodeTime16($)
|
|||||||
sub
|
sub
|
||||||
CUL_HM_convTemp($)
|
CUL_HM_convTemp($)
|
||||||
{
|
{
|
||||||
my ($in) = @_;
|
my ($val) = @_;
|
||||||
return "$in is not a number" if($in !~ m/^\d+$/ && $in !~ m/\d+\.\d+$/);
|
|
||||||
return "$in is out of bounds (6 .. 30)" if($in < 6 || $in > 30);
|
my @list = map { ($_.".0", $_+0.5) } (6..30);
|
||||||
return sprintf("%02X", $in*2);
|
pop @list;
|
||||||
|
return "Invalid temperature $val, choose one of on off " . join(" ",@list)
|
||||||
|
if(!($val eq "on" || $val eq "off" ||
|
||||||
|
($val =~ m/^\d*\.?\d+$/ && $val >= 6 && $val <= 30)));
|
||||||
|
$val = 100 if($val eq "on");
|
||||||
|
$val = 0 if($val eq "off");
|
||||||
|
return sprintf("%02X", $val*2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#############################
|
#############################
|
||||||
|
@ -219,12 +219,16 @@ FHT_Set($@)
|
|||||||
|
|
||||||
if ($cmd =~ m/-temp/) {
|
if ($cmd =~ m/-temp/) {
|
||||||
|
|
||||||
return "Invalid temperature, use NN.N" if($val !~ m/^\d*\.?\d+$/);
|
my @list = map { ($_.".0", $_+0.5) } (6..30);
|
||||||
return "Invalid temperature, must between 5.5 and 30.5"
|
pop @list;
|
||||||
if($val < 5.5 || $val > 30.5);
|
return "Invalid temperature $val, choose one of on off " . join(" ",@list)
|
||||||
|
if(!($val eq "on" || $val eq "off" ||
|
||||||
|
($val =~ m/^\d*\.?\d+$/ && $val >= 5.5 && $val <= 30.5)));
|
||||||
|
|
||||||
|
$val = 30.5 if($val eq "on");
|
||||||
|
$val = 5.5 if($val eq "off");
|
||||||
my $a = int($val*2);
|
my $a = int($val*2);
|
||||||
$arg .= sprintf("%02x", $a);
|
$arg .= sprintf("%02x", $a);
|
||||||
$ret .= sprintf("Rounded temperature to %.1f", $a/2) if($a/2 != $val);
|
|
||||||
$val = sprintf("%.1f", $a/2);
|
$val = sprintf("%.1f", $a/2);
|
||||||
|
|
||||||
} elsif($cmd =~ m/-from/ || $cmd =~ m/-to/) {
|
} elsif($cmd =~ m/-from/ || $cmd =~ m/-to/) {
|
||||||
@ -239,7 +243,7 @@ FHT_Set($@)
|
|||||||
|
|
||||||
} elsif($cmd eq "mode") {
|
} elsif($cmd eq "mode") {
|
||||||
|
|
||||||
return "Invalid mode, use one of " . join(" ", sort keys %m2c)
|
return "Invalid mode, choose one of " . join(" ", sort keys %m2c)
|
||||||
if(!defined($m2c{$val}));
|
if(!defined($m2c{$val}));
|
||||||
$arg .= sprintf("%02x", $m2c{$val});
|
$arg .= sprintf("%02x", $m2c{$val});
|
||||||
|
|
||||||
|
@ -889,8 +889,7 @@ FW_showRoom()
|
|||||||
$txt = ReadingsVal($d, "measured-temp", "");
|
$txt = ReadingsVal($d, "measured-temp", "");
|
||||||
$txt =~ s/ .*//;
|
$txt =~ s/ .*//;
|
||||||
$txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/);
|
$txt = sprintf("%2.1f", int(2*$txt)/2) if($txt =~ m/[0-9.-]/);
|
||||||
my @tv = map { ($_.".0", $_+0.5) } (5..30);
|
my @tv = split(" ", getAllSets("$d desired-temp"));
|
||||||
shift(@tv); # 5.0 is not valid
|
|
||||||
$txt = int($txt*20)/$txt if($txt =~ m/^[0-9].$/);
|
$txt = int($txt*20)/$txt if($txt =~ m/^[0-9].$/);
|
||||||
|
|
||||||
FW_pO "<td>".
|
FW_pO "<td>".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user