From e6eb355c187a6549f8210f3bc0bb28809e544c0b Mon Sep 17 00:00:00 2001 From: justme-1968 Date: Sat, 4 Oct 2014 15:11:14 +0000 Subject: [PATCH] netatmo: initialize stateFormat for new format public devices git-svn-id: https://svn.fhem.de/fhem/trunk@6674 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/38_netatmo.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fhem/FHEM/38_netatmo.pm b/fhem/FHEM/38_netatmo.pm index 55d76c325..3fe425bf2 100644 --- a/fhem/FHEM/38_netatmo.pm +++ b/fhem/FHEM/38_netatmo.pm @@ -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];