mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
76_SMAPortal: contrib 3.1.0
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@22209 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a7cdd0eca1
commit
c22dc66aa0
@ -421,8 +421,8 @@ sub Set { ## no critic 'complexity'
|
|||||||
|
|
||||||
$c = qq{This device provides a praphical output of SMA Sunny Portal values.\n}.
|
$c = qq{This device provides a praphical output of SMA Sunny Portal values.\n}.
|
||||||
qq{The device "$name" needs to contain "forecastData" in attribute "providerLevel".\n}.
|
qq{The device "$name" needs to contain "forecastData" in attribute "providerLevel".\n}.
|
||||||
qq{If you want see weather conditions, this attribute has to contain "weatherData" as well. }.
|
|
||||||
qq{The attribute "providerLevel" must also contain "consumerCurrentdata" if you want switch your consumer connectet to the SMA Home Manager.};
|
qq{The attribute "providerLevel" must also contain "consumerCurrentdata" if you want switch your consumer connectet to the SMA Home Manager.};
|
||||||
|
|
||||||
CommandAttr($hash->{CL},"$htmldev comment $c");
|
CommandAttr($hash->{CL},"$htmldev comment $c");
|
||||||
|
|
||||||
# es muß nicht unbedingt jedes der möglichen userattr unbedingt vorbesetzt werden
|
# es muß nicht unbedingt jedes der möglichen userattr unbedingt vorbesetzt werden
|
||||||
@ -657,7 +657,7 @@ sub Attr {
|
|||||||
$val = ($do == 1 ? "disabled" : "initialized");
|
$val = ($do == 1 ? "disabled" : "initialized");
|
||||||
|
|
||||||
if($do) {
|
if($do) {
|
||||||
delread($hash);
|
deleteData($hash);
|
||||||
delete $hash->{MODE};
|
delete $hash->{MODE};
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
} else {
|
} else {
|
||||||
@ -1777,7 +1777,7 @@ sub ParseData { ## no critic
|
|||||||
@da = split "###", $lc;
|
@da = split "###", $lc;
|
||||||
}
|
}
|
||||||
|
|
||||||
delread($hash, 1);
|
deleteData($hash, 1);
|
||||||
|
|
||||||
readingsBeginUpdate($hash);
|
readingsBeginUpdate($hash);
|
||||||
|
|
||||||
@ -2581,19 +2581,27 @@ return;
|
|||||||
}
|
}
|
||||||
|
|
||||||
################################################################
|
################################################################
|
||||||
# delete Readings
|
# delete Readings und Hash HELPER-Daten
|
||||||
# $conspl = providerLevel berücksichtigen
|
# $conspl = providerLevel berücksichtigen
|
||||||
################################################################
|
################################################################
|
||||||
sub delread {
|
sub deleteData {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
my $conspl = shift;
|
my $conspl = shift;
|
||||||
my $name = $hash->{NAME};
|
my $name = $hash->{NAME};
|
||||||
my @allrds = keys%{$defs{$name}{READINGS}};
|
my @allrds = keys%{$defs{$name}{READINGS}};
|
||||||
|
|
||||||
my $bl = "state|lastCycleTime|Counter|loginState"; # Blacklist
|
my $bl = "state|lastCycleTime|Counter|loginState"; # Blacklist
|
||||||
|
|
||||||
|
if(!$subs{$name}{forecastData}{doit}) { # wenn forecastData nicht abgerufen werden sollen -> Wetterdaten im HELPER löschen
|
||||||
|
my $fclvl = $stpl{forecastData}{level};
|
||||||
|
delete $hash->{HELPER}{"${fclvl}_ThisHour_WeatherId"};
|
||||||
|
for my $i (1..23) {
|
||||||
|
$i = sprintf("%02d",$i);
|
||||||
|
delete $hash->{HELPER}{"${fclvl}_NextHour${i}_WeatherId"};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($conspl) {
|
if($conspl) { # Readings löschen wenn nicht im providerLevel enthalten
|
||||||
# Readings löschen wenn nicht im providerLevel enthalten
|
|
||||||
for my $key(@allrds) {
|
for my $key(@allrds) {
|
||||||
my ($lvl) = $key =~ m/^(L\d+)_/x;
|
my ($lvl) = $key =~ m/^(L\d+)_/x;
|
||||||
if($lvl) {
|
if($lvl) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user