2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

netatmo: initialize stateFormat for new format public devices

git-svn-id: https://svn.fhem.de/fhem/trunk@6674 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2014-10-04 15:11:14 +00:00
parent 6eb8e99d79
commit e6eb355c18

View File

@ -93,6 +93,18 @@ netatmo_Define($$)
return "module $module already defined as $d->{NAME}" if( defined($d) && $d->{NAME} ne $name );
$modules{$hash->{TYPE}}{defptr}{"M$module"} = $hash;
my $state_format;
if( $readings =~ m/temperature/ ) {
$state_format .= " " if( $state_format );
$state_format .= "T: temperature";
}
if( $readings =~ m/humidity/ ) {
$state_format .= " " if( $state_format );
$state_format .= "H: humidity";
}
$attr{$name}{stateFormat} = $state_format if( !defined($attr{$name}{stateFormat}) && defined($state_format) );
} else {
my $lon = $a[4];
my $lat = $a[5];