From 0231143800802254d5f9bc56ba9a2ba7bba3d627 Mon Sep 17 00:00:00 2001 From: narsskrarc <> Date: Wed, 5 Aug 2015 09:00:12 +0000 Subject: [PATCH] 34_NUT: Versucht bei disabled=1 nicht mehr, eine Verbindung aufzubauen git-svn-id: https://svn.fhem.de/fhem/trunk@9023 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/34_NUT.pm | 25 +++++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7c89ba361..7dc90deeb 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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. + - bugfix: 34_NUT: versucht bei disabled=1 nicht mehr, eine Verbindung aufzubauen - change: 57_CALVIEW: - replace unwanted backslash before a comma sign - bugfix: 95_Dashboard: fixed sorting for grouped devices - bugfix: 95_Dashboard: fixed style issue with colorpicker in ios6touchpad style diff --git a/fhem/FHEM/34_NUT.pm b/fhem/FHEM/34_NUT.pm index 8894b02ea..f74e80541 100644 --- a/fhem/FHEM/34_NUT.pm +++ b/fhem/FHEM/34_NUT.pm @@ -3,7 +3,7 @@ # # Abfrage einer UPS über die Network UPS Tools (www.networkupstools.org) # -# 14.06.2015 +# 05.08.2015 # # DEFINE bla NUT [[:]] @@ -164,17 +164,17 @@ sub NUT_ListVar($) { my ($hash) = @_; my $name = $hash->{NAME}; - if ($hash->{STATE} eq 'disconnected') { - # Verbindung scheint nicht zu bestehen - # Alles abbrechen, ich verlasse mich auf DevIo_OpenDev, dass es alles wieder anwirft, sobald die Verbindung wieder steht - $hash->{pollValState} = 0; - RemoveInternalTimer("pollTimer:".$name); - DevIo_OpenDev($hash, 1, "NUT_DevInit"); - return; - } - if (not defined $attr{$name}{disable} or $attr{$name}{disable} == 0) { + if ($hash->{STATE} eq 'disconnected') { + # Verbindung scheint nicht zu bestehen + # Alles abbrechen, ich verlasse mich auf DevIo_OpenDev, dass es alles wieder anwirft, sobald die Verbindung wieder steht + $hash->{pollValState} = 0; + RemoveInternalTimer("pollTimer:".$name); + DevIo_OpenDev($hash, 1, "NUT_DevInit"); + return; + } + if (defined $hash->{WaitForAnswer}) { # Keine Antwort auf die letzte Frage -> NUT nicht mehr erreichbar! Log3 $name, 3, "NUT antwortet nicht"; @@ -201,6 +201,7 @@ sub NUT_ListVar($) { } else { Log3 $name, 5, "NUT polling disabled."; + delete $hash->{WaitForAnswer}; } RemoveInternalTimer("pollTimer:".$name); @@ -382,8 +383,6 @@ sub NUT_makeReadings($) { Values of the UPS which are used as Readings (ups.status is read anyway)
Example:
attr theUPS asReadings battery.charge,battery.runtime,input.voltage,ups.load,ups.power,ups.realpower
-
  • withUnits
    - When set to 1, unit are attached to the readings.

  • @@ -436,8 +435,6 @@ sub NUT_makeReadings($) { Mit Kommata getrennte Liste der USV-Werte, die als Readings verwendet werden sollen (ups.status wird auf jeden Fall gelesen).
    Beispiel:
    attr dieUSV asReadings battery.charge,battery.runtime,input.voltage,ups.load,ups.power,ups.realpower
    -
  • withUnits
    - Mit dem Setzen auf 1 werden die passenden Einheiten an die Readings angefügt.