2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 03:06:37 +00:00

76_Solarforcast: contrib 0.1.0

git-svn-id: https://svn.fhem.de/fhem/trunk@23361 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-12-16 09:15:37 +00:00
parent e62a8c4ae2
commit 3faacc7c34

View File

@ -640,6 +640,8 @@ sub _transferForecastValues {
push @$daref, "Tomorrow_HourSunRise:".$fc1_SunRise;
push @$daref, "Tomorrow_HourSunSet:". $fc1_SunSet;
deleteReadingspec ($myHash, "NextHour.*");
for my $num (0..47) {
my $fh = $chour + $num;
$fd = int ($fh / 24) ;
@ -1876,6 +1878,23 @@ sub createReadings {
return;
}
################################################################
# alle Readings eines Devices oder nur Reaging-Regex
# löschen
################################################################
sub deleteReadingspec {
my $hash = shift;
my $spec = shift // ".*";
my $readingspec = '^'.$spec.'$';
for my $reading ( grep { /$readingspec/ } keys %{$hash->{READINGS}} ) {
readingsDelete($hash, $reading);
}
return;
}
######################################################################################
# NOTIFYDEV erstellen
######################################################################################