2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-28 02:44:53 +00:00

98_dewpoint.pm: Fix several typos

git-svn-id: https://svn.fhem.de/fhem/trunk@18585 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hotbso 2019-02-13 17:03:56 +00:00
parent 491484cf41
commit 52db808637

View File

@ -189,7 +189,7 @@ dewpoint_Notify($$)
} elsif ($cmd_type eq "alarm") { } elsif ($cmd_type eq "alarm") {
if (!defined($hash->{DEVNAME_REF}) || !defined($hash->{DIFF_TEMP})) { if (!defined($hash->{DEVNAME_REF}) || !defined($hash->{DIFF_TEMP})) {
# should never happen! # should never happen!
Log3($hashName, 1, "Error dewpoint: DEVNAME_REF || DIFF_TEMP undefined"); Log3($hashName, 1, "dewpoint_notify: error: DEVNAME_REF || DIFF_TEMP undefined");
return ""; return "";
} }
$devname_ref = $hash->{DEVNAME_REF}; $devname_ref = $hash->{DEVNAME_REF};
@ -198,7 +198,7 @@ dewpoint_Notify($$)
. "dev_regex=$re, devname_ref=$devname_ref, diff_temp=$diff_temp"); . "dev_regex=$re, devname_ref=$devname_ref, diff_temp=$diff_temp");
} else { } else {
# should never happen: # should never happen:
Log3($hashName, 1, "Error notify_dewpoint: <1> unknown cmd_type ".$cmd_type); Log3($hashName, 1, "dewpoint_notify: error: unknown cmd_type ".$cmd_type);
return ""; return "";
} }
@ -231,13 +231,13 @@ dewpoint_Notify($$)
if ($s =~ /H: [-+]?([0-9]*\.[0-9]+|[0-9]+)/) { if ($s =~ /H: [-+]?([0-9]*\.[0-9]+|[0-9]+)/) {
$humidity = $1; $humidity = $1;
} }
Log3($hashName, 5, "dewpoint_notify T: H:, temp=$temperature hum=$humidity"); Log3($hashName, 5, "dewpoint_notify: T: H:, temp=$temperature hum=$humidity");
} elsif ($evName eq $temp_name.":") { } elsif ($evName eq $temp_name.":") {
$temperature = $val; $temperature = $val;
Log3($hashName, 5, "dewpoint_notify temperature! dev=$devName, temp_name=$temp_name, temp=$temperature"); Log3($hashName, 5, "dewpoint_notify: temperature! dev=$devName, temp_name=$temp_name, temp=$temperature");
} elsif ($evName eq $hum_name.":") { } elsif ($evName eq $hum_name.":") {
$humidity = $val; $humidity = $val;
Log3($hashName, 5, "dewpoint_notify humidity! dev=$devName, hum_name=$hum_name, hum=$humidity"); Log3($hashName, 5, "dewpoint_notify: humidity! dev=$devName, hum_name=$hum_name, hum=$humidity");
} }
} }
@ -246,7 +246,7 @@ dewpoint_Notify($$)
# Check if Attribute timeout is set # Check if Attribute timeout is set
my $timeout = AttrVal($hash->{NAME}, "max_timediff", $dewpoint_time_diff_default); my $timeout = AttrVal($hash->{NAME}, "max_timediff", $dewpoint_time_diff_default);
Log3($hashName, 5,"dewpoint max_timediff=$timeout"); Log3($hashName, 5,"dewpoint_notify: max_timediff=$timeout");
if (($humidity eq "") && (($temperature eq ""))) { if (($humidity eq "") && (($temperature eq ""))) {
return undef; # no way to calculate dewpoint! return undef; # no way to calculate dewpoint!
@ -276,7 +276,7 @@ dewpoint_Notify($$)
# We found temperature and humidity. so we can calculate dewpoint first # We found temperature and humidity. so we can calculate dewpoint first
# Prüfen, ob humidity im erlaubten Bereich ist # Prüfen, ob humidity im erlaubten Bereich ist
if (($humidity <= 0) || ($humidity >= 110)){ if (($humidity <= 0) || ($humidity >= 110)){
Log3($hashName, 1, "Error dewpoint: humidity invalid: $humidity"); Log3($hashName, 1, "dewpoint_notify: humidity invalid: $humidity");
return undef; return undef;
} }
@ -300,27 +300,27 @@ dewpoint_Notify($$)
readingsBeginUpdate($dev); readingsBeginUpdate($dev);
my $rval; my $rval;
my $rname; my $rname;
my $abs_hunidity = dewpoint_absFeuchte($temperature, $humidity); my $abs_humidity = dewpoint_absFeuchte($temperature, $humidity);
my $aFeuchte = AttrVal($hashName, "absFeuchte", undef); my $aFeuchte = AttrVal($hashName, "absFeuchte", undef);
if (defined($aFeuchte)) { if (defined($aFeuchte)) {
$rname = "absFeuchte"; $rname = "absFeuchte";
readingsBulkUpdate($dev, $rname, $abs_hunidity); readingsBulkUpdate($dev, $rname, $abs_humidity);
Log3($hashName, 5, "dewpoint absFeuchte= $abs_hunidity"); Log3($hashName, 5, "dewpoint_notify: absFeuchte= $abs_humidity");
$aFeuchte = "A: " . $abs_hunidity; $aFeuchte = "A: " . $abs_humidity;
} }
my $ah_rname = AttrVal($hashName, "absoluteHumidity", undef); my $ah_rname = AttrVal($hashName, "absoluteHumidity", undef);
if (defined($ah_rname)) { if (defined($ah_rname)) {
readingsBulkUpdate($dev, $ah_rname, $abs_hunidity); readingsBulkUpdate($dev, $ah_rname, $abs_humidity);
Log3($hashName, 5, "dewpoint $ah_rname= $abs_hunidity"); Log3($hashName, 5, "dewpoint_notify: $ah_rname= $abs_humidity");
$aFeuchte = "A: " . $abs_hunidity if !defined($aFeuchte); $aFeuchte = "A: " . $abs_humidity if !defined($aFeuchte);
} }
my $vp_rname = AttrVal($hashName, "vapourPressure", undef); my $vp_rname = AttrVal($hashName, "vapourPressure", undef);
if (defined($vp_rname)) { if (defined($vp_rname)) {
my $vp = round(10 * dewpoint_vp($temperature, $humidity), 1); my $vp = round(10 * dewpoint_vp($temperature, $humidity), 1);
readingsBulkUpdate($dev, $vp_rname, $vp); readingsBulkUpdate($dev, $vp_rname, $vp);
Log3($hashName, 5, "dewpoint $vp_rname= $vp"); Log3($hashName, 5, "dewpoint_notify: $vp_rname= $vp");
} }
$rname = $new_name; $rname = $new_name;
@ -444,7 +444,7 @@ dewpoint_Notify($$)
} else { } else {
# should never happen: # should never happen:
Log3($hashName, 1, "Error notify_dewpoint: <2> unknown cmd_type ".$cmd_type); Log3($hashName, 1, "dewpoint_notify: unknown cmd_type ".$cmd_type);
return ""; return "";
} }
@ -544,11 +544,11 @@ dewpoint_absFeuchte ($$)
Dewpoint calculations. Offers three different ways to use dewpoint: <br> Dewpoint calculations. Offers three different ways to use dewpoint: <br>
<ul> <ul>
<li><b>dewpoint</b><br> <li><b>dewpoint</b><br>
Compute additional event dewpoint from a sensor offering temperature and humidity.</li> Compute additional reading dewpoint from a sensor offering temperature and humidity.</li>
<li><b>fan</b><br> <li><b>fan</b><br>
Generate a event to turn a fan on if the outside air has less water than the inside.</li> Generate a event to turn a fan on if the outside air has less water than the inside.</li>
<li><b>alarm</b><br> <li><b>alarm</b><br>
Generate a mold alarm if a reference temperature is lower that the current dewpoint.</li> Generate a mold alarm if a reference temperature is lower than the current dewpoint.</li>
<br> <br>
</ul> </ul>
@ -566,8 +566,7 @@ dewpoint_absFeuchte ($$)
<b>Obsolete, avoid for new definitions</b><br> <b>Obsolete, avoid for new definitions</b><br>
&nbsp;&nbsp;If &lt;temp_name&gt; is T then use temperature from state T: H:, add &lt;new_name&gt; to the STATE. &nbsp;&nbsp;If &lt;temp_name&gt; is T then use temperature from state T: H:, add &lt;new_name&gt; to the STATE.
The addition to STATE only occurs if the target device does not define attribute "stateFormat".<br> The addition to STATE only occurs if the target device does not define attribute "stateFormat".<br>
If the obsolete behaviour of STATE is mandatory set attribute <code>legacyStateHandling</code> If the obsolete behaviour of STATE is mandatory set attribute <code>legacyStateHandling</code>.
should be set.
</ul> </ul>
<br><br> <br><br>
@ -630,7 +629,7 @@ dewpoint_absFeuchte ($$)
<code>define &lt;name&gt; dewpoint alarm &lt;devicename-regex&gt; &lt;devicename-reference&gt; &lt;diff-temp&gt;</code><br> <code>define &lt;name&gt; dewpoint alarm &lt;devicename-regex&gt; &lt;devicename-reference&gt; &lt;diff-temp&gt;</code><br>
<br> <br>
<ul> <ul>
Generate a mold alarm if a reference temperature is lower that the current dewpoint. Generate a mold alarm if a reference temperature is lower than the current dewpoint.
<ul> <ul>
<li> <li>
Generate reading/event "alarm: on" if temperature of &lt;devicename-reference&gt; - &lt;diff-temp&gt; is lower Generate reading/event "alarm: on" if temperature of &lt;devicename-reference&gt; - &lt;diff-temp&gt; is lower