From f9c0e84035e11dbb0fbb1c35e526199572343bdb Mon Sep 17 00:00:00 2001 From: nasseeder1 Date: Sun, 24 Mar 2024 10:03:33 +0000 Subject: [PATCH] 76_SolarForecast: contrib 1.17.0 git-svn-id: https://svn.fhem.de/fhem/trunk@28704 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DS_Starter/76_SolarForecast.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fhem/contrib/DS_Starter/76_SolarForecast.pm b/fhem/contrib/DS_Starter/76_SolarForecast.pm index d23fb3832..9d5f94617 100644 --- a/fhem/contrib/DS_Starter/76_SolarForecast.pm +++ b/fhem/contrib/DS_Starter/76_SolarForecast.pm @@ -5427,15 +5427,20 @@ sub _attrWeatherDev { ## no critic "not used" my $hash = $paref->{hash}; my $name = $paref->{name}; my $aVal = $paref->{aVal} // return qq{no weather forecast device specified} if($paref->{cmd} eq 'set'); + my $aName = $paref->{aName}; return if(!$init_done); if ($paref->{cmd} eq 'set' ) { if ($aVal ne 'OpenMeteoDWD-API' && (!$defs{$aVal} || $defs{$aVal}{TYPE} ne "DWD_OpenData")) { - return qq{The device "$aVal" doesn't exist or has no TYPE "DWD_OpenData"}; + return qq{The device "$aVal" doesn't exist or has no TYPE 'DWD_OpenData'}; } if ($aVal eq 'OpenMeteoDWD-API') { + if ($aName ne 'ctrlWeatherDev1') { + return qq{Only the leading attribute 'ctrlWeatherDev1' can set to 'OpenMeteoDWD-API'}; + } + CommandSet (undef,"$name currentRadiationAPI $aVal"); # automatisch currentRadiationAPI setzen return; }