2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

30_pilight_temp: attribut corrHumidity to correct humidity value

git-svn-id: https://svn.fhem.de/fhem/trunk@8589 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
risiko79 2015-05-17 07:32:22 +00:00
parent fcf39c6d85
commit b9ed47c838
2 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- feature: 30_pilight_temp: attribut corrHumidity to correct humidity
- feature: 76_MSGMail: Add attribute mailtype as suggested by Roger
(forum #37206)
- feature: 30_pilight_temp: reading battery state, attribut corrTemp to correct temperature

View File

@ -1,5 +1,5 @@
##############################################
# $Id: 20_pilight_temp.pm 0.12 2015-05-16 Risiko $
# $Id: 30_pilight_temp.pm 0.13 2015-05-17 Risiko $
#
# Usage
#
@ -11,6 +11,7 @@
# V 0.11 2015-03-29 - FIX: $readingFnAttributes
# V 0.12 2015-05-16 - NEW: reading battery
# V 0.12 2015-05-16 - NEW: attribut corrTemp, a factor to modify temperatur
# V 0.13 2015-05-17 - NEW: attribut corrHumidity, a factor to modify humidity
##############################################
package main;
@ -31,7 +32,7 @@ sub pilight_temp_Initialize($)
$hash->{DefFn} = "pilight_temp_Define";
$hash->{Match} = "^PITEMP";
$hash->{ParseFn} = "pilight_temp_Parse";
$hash->{AttrList} = "corrTemp ".$readingFnAttributes;
$hash->{AttrList} = "corrTemp corrHumidity ".$readingFnAttributes;
}
#####################################
@ -90,7 +91,13 @@ sub pilight_temp_Parse($$)
readingsBeginUpdate($chash);
readingsBulkUpdate($chash,"state",$temp);
readingsBulkUpdate($chash,"temperature",$temp);
readingsBulkUpdate($chash,"humidity",$humidity) if (defined($humidity) && $humidity ne "");
if (defined($humidity) && $humidity ne "") {
my $corrHumidity = AttrVal($chash->{NAME}, "corrHumidity",1);
$humidity = $humidity * $corrHumidity;
readingsBulkUpdate($chash,"humidity",$humidity);
}
readingsBulkUpdate($chash,"battery",$battery) if (defined($battery) && $battery ne "");
readingsEndUpdate($chash, 1);
@ -151,6 +158,9 @@ sub pilight_temp_Parse($$)
<li><a name="corrTemp">corrTemp</a><br>
A factor (e.q. 0.1) to correct the temperture value. Default: 1
</li>
<li><a name="corrHumidity">corrHumidity</a><br>
A factor (e.q. 0.1) to correct the humidity value. Default: 1
</li>
</ul>
</ul>