From 658fc8def6425d2eb314a6638334e422a6de0eec Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 3 Dec 2023 19:05:36 +0000 Subject: [PATCH] 76_SolarForecast: plantConfig: check module update in repo git-svn-id: https://svn.fhem.de/fhem/trunk@28242 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/76_SolarForecast.pm | 63 ++++++++++++++++++++++++++++++----- fhem/MAINTAINER.txt | 5 ++- 3 files changed, 58 insertions(+), 11 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7d611de14..467898211 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. + - feature: 76_SolarForecast: plantConfig: check module update in repo - feature: 76_SolarForecast: graphicHeaderOwnspec can show set-commands and attributes of other devices - feature: 72_FRITZBOX: neue set diff --git a/fhem/FHEM/76_SolarForecast.pm b/fhem/FHEM/76_SolarForecast.pm index 04a456fdc..2f967942f 100644 --- a/fhem/FHEM/76_SolarForecast.pm +++ b/fhem/FHEM/76_SolarForecast.pm @@ -46,6 +46,7 @@ eval "use JSON;1;" or my $jsonabs = 'JSON'; eval "use AI::DecisionTree;1;" or my $aidtabs = 'AI::DecisionTree'; ## no critic 'eval' use FHEM::SynoModules::SMUtils qw( + checkModVer evaljson getClHash delClHash @@ -151,6 +152,8 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "1.4.3" => "03.12.2023 hidden set or attr commands in user specific header area when called by 'get ... html' ". + "plantConfig: check module update in repo ", "1.4.2" => "02.12.2023 ___getFWwidget: codechange ___getFWwidget using __widgetFallback function ", "1.4.1" => "01.12.2023 ___getFWwidget: adjust for FHEMWEB feature forum:#136019 ", "1.4.0" => "29.11.2023 graphicHeaderOwnspec: can manage attr / sets of other devs by @ ", @@ -8299,7 +8302,7 @@ sub pageAsHtml { my $gsel = shift // ""; # direkte Auswahl welche Grafik zurück gegeben werden soll (both, flow, forecast) my $ret = ""; - $ret .= entryGraphic ($name, $ftui, $gsel); + $ret .= entryGraphic ($name, $ftui, $gsel, 1); $ret .= ""; return $ret; @@ -8312,6 +8315,7 @@ sub entryGraphic { my $name = shift; my $ftui = shift // ""; my $gsel = shift // ""; # direkte Auswahl welche Grafik zurück gegeben werden soll (both, flow, forecast) + my $pah = shift // 0; # 1 wenn durch pageAsHtml aufgerufen my $hash = $defs{$name}; @@ -8346,6 +8350,7 @@ sub entryGraphic { name => $name, type => $hash->{TYPE}, ftui => $ftui, + pah => $pah, maxhours => $maxhours, t => time, modulo => 1, @@ -9108,6 +9113,7 @@ sub __createOwnSpec { my $name = $paref->{name}; my $dstyle = $paref->{dstyle}; # TD-Style my $hdrDetail = $paref->{hdrDetail}; + my $pah = $paref->{pah}; # 1 wenn durch pageAsHtml abgerufen my $vinr = 4; # Spezifikationen in einer Zeile my $spec = AttrVal ($name, 'graphicHeaderOwnspec', ''); @@ -9156,6 +9162,11 @@ sub __createOwnSpec { my $setcmd = ___getFWwidget ($name, $dev, $elm, $allsets, 'set'); # Set-Kommandos identifizieren if ($setcmd) { + if ($pah) { # bei get pageAsHtml setter/attr nicht anzeigen (js Fehler) + undef $h->{$k}{label}; + $setcmd = ''; + } + $v->{$k} = $setcmd; $u->{$k} = q{}; @@ -9166,6 +9177,11 @@ sub __createOwnSpec { my $attrcmd = ___getFWwidget ($name, $dev, $elm, $allattrs, 'attr'); # Attr-Kommandos identifizieren if ($attrcmd) { + if ($pah) { # bei get pageAsHtml setter/attr nicht anzeigen (js Fehler) + undef $h->{$k}{label}; + $attrcmd = ''; + } + $v->{$k} = $attrcmd; $u->{$k} = q{}; @@ -9321,6 +9337,7 @@ sub ___widgetFallback { if (!defined $current) { $reading = 'state'; + $current = ' '; } if ($current =~ /(().*?)/xs) { # Eleminierung von störenden HTML Elementen aus aktuellem Readingwert @@ -12639,7 +12656,7 @@ sub checkPlantConfig { my $aiprep = isPrepared4AI ($hash, 'full'); my $aiusemsg = CurrentVal ($hash, 'aicanuse', ''); my $einstds = ""; - + if (!$eocr || $eocr ne '.*') { $einstds = 'to .*' if($eocr ne '.*'); $result->{'Common Settings'}{state} = $info; @@ -12658,7 +12675,29 @@ sub checkPlantConfig { if (!$aiprep) { $result->{'Common Settings'}{state} = $info; $result->{'Common Settings'}{result} .= qq{The AI support is not used.
}; - $result->{'Common Settings'}{note} .= qq{$aiusemsg
}; + $result->{'Common Settings'}{note} .= qq{$aiusemsg.
}; + $result->{'Common Settings'}{info} = 1; + } + + my ($cmerr, $cmupd, $cmmsg, $cmrec) = checkModVer ($name, '76_SolarForecast', 'https://fhem.de/fhemupdate/controls_fhem.txt'); + + if (!$cmerr && !$cmupd) { + $result->{'Common Settings'}{note} .= qq{$cmmsg
$cmrec
}; + $result->{'Common Settings'}{note} .= qq{checked module:
}; + $result->{'Common Settings'}{note} .= qq{76_SolarForecast
}; + } + + if ($cmerr) { + $result->{'Common Settings'}{state} = $warn; + $result->{'Common Settings'}{result} .= qq{$cmmsg
}; + $result->{'Common Settings'}{note} .= qq{$cmrec
}; + $result->{'Common Settings'}{warn} = 1; + } + + if ($cmupd) { + $result->{'Common Settings'}{state} = $info; + $result->{'Common Settings'}{result} .= qq{$cmmsg
}; + $result->{'Common Settings'}{note} .= qq{$cmrec
}; $result->{'Common Settings'}{info} = 1; } @@ -15343,8 +15382,12 @@ to ensure that the system configuration is correct.
  • html

    - The solar graphic is retrieved and rendered as HTML code. One of the following selections can be given as an - argument to the command:

    + The SolarForecast graphic is retrieved and displayed as HTML code.
    + Note: By the attribute graphicHeaderOwnspec + generated set or attribute commands in the user-specific area of the header are generally hidden for technical + reasons.
    + One of the following selections can be given as an argument to the command: +

      @@ -17295,8 +17338,12 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden.
      • html

        - Die Solar Grafik wird als HTML-Code abgerufen und wiedergegeben. Als Argument kann dem Befehl eine der folgenden - Selektionen mitgegeben werden:

        + Die SolarForecast Grafik wird als HTML-Code abgerufen und wiedergegeben.
        + Hinweis: Durch das Attribut graphicHeaderOwnspec + generierte set-Kommandos oder Attribut-Befehle im Anwender spezifischen Bereich des Headers werden aus technischen + Gründen generell ausgeblendet.
        + Als Argument kann dem Befehl eine der folgenden Selektionen mitgegeben werden: +

      @@ -18476,7 +18523,7 @@ die ordnungsgemäße Anlagenkonfiguration geprüft werden. "utf8": 0, "HttpUtils": 0, "JSON": 4.020, - "FHEM::SynoModules::SMUtils": 1.0220, + "FHEM::SynoModules::SMUtils": 1.0270, "Time::HiRes": 0, "MIME::Base64": 0, "Storable": 0 diff --git a/fhem/MAINTAINER.txt b/fhem/MAINTAINER.txt index 7a7eec396..ac71c0266 100644 --- a/fhem/MAINTAINER.txt +++ b/fhem/MAINTAINER.txt @@ -639,9 +639,8 @@ FHEM/lib/UPnP/* Reinerlein Multimedia lib/FHEM/Core/Timer/Helper.pm sidey79 FHEM Development lib/FHEM/Core/Timer/Register.pm Beta-User FHEM Development -lib/FHEM/SynoModules/API.pm DS_Starter Sonstiges -lib/FHEM/SynoModules/SMUtils.pm DS_Starter Sonstiges -lib/FHEM/SynoModules/ErrCodes.pm DS_Starter Sonstiges +lib/FHEM/SynoModules/* DS_Starter Sonstiges +lib/FHEM/SolarForecast/* DS_Starter Solaranlagen lib/FHEM/Text/Unicode.pm Adimarantis FHEM Development lib/FHEM/Utility/CTZ.pm DS_Starter Sonstiges