From 87d433ea247cb6c31b4aa549df96c781fc41537f Mon Sep 17 00:00:00 2001 From: tpoitzsch <> Date: Tue, 9 Dec 2014 21:49:56 +0000 Subject: [PATCH] PROPLANTA: Improved debugging git-svn-id: https://svn.fhem.de/fhem/trunk@7180 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_PROPLANTA.pm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/59_PROPLANTA.pm b/fhem/FHEM/59_PROPLANTA.pm index 69b0ba386..c788ac9b5 100644 --- a/fhem/FHEM/59_PROPLANTA.pm +++ b/fhem/FHEM/59_PROPLANTA.pm @@ -626,10 +626,18 @@ sub PROPLANTA_Done($) if (keys %values > 0) { - my $newState = "Tmin: " . $values{fc0_tempMin} . " Tmax: " . $values{fc0_tempMax}; - # Achtung! Nach Mitternacht fehlen für 1 h die aktuellen Werte - $newState .= " T: " . $values{temperature} . " H: " . $values{humidity} . " W: " . $values{wind} . " P: " . $values{pressure} - if defined $values{temperature}; + my $newState; + if (defined $values{fc0_tempMin} && defined $values{fc0_tempMax}) + { + $newState = "Tmin: " . $values{fc0_tempMin} . " Tmax: " . $values{fc0_tempMax}; + # Achtung! Nach Mitternacht fehlen für 1 h die aktuellen Werte + $newState .= " T: " . $values{temperature} . " H: " . $values{humidity} . " W: " . $values{wind} . " P: " . $values{pressure} + if defined $values{temperature} && defined $values{humidity} && defined $values{wind} && defined $values{pressure}; + } + else + { + $newState = "Error: Could not capture all data. Please check URL or city name."; + } readingsBulkUpdate($hash, "state", $newState); readingsBulkUpdate( $hash, "lastConnection", keys( %values )." values captured" ); PROPLANTA_Log $hash, 4, keys( %values )." values captured";