From b69b2225889194978544a3d6277dcafc5b76312a Mon Sep 17 00:00:00 2001 From: "klaus.schauer" <> Date: Mon, 7 Dec 2020 18:05:47 +0000 Subject: [PATCH] 00_ElsnerWS: minor function and commandref changes git-svn-id: https://svn.fhem.de/fhem/trunk@23307 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/00_ElsnerWS.pm | 81 ++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 37 deletions(-) diff --git a/fhem/FHEM/00_ElsnerWS.pm b/fhem/FHEM/00_ElsnerWS.pm index faeaa497c..1f21667e0 100644 --- a/fhem/FHEM/00_ElsnerWS.pm +++ b/fhem/FHEM/00_ElsnerWS.pm @@ -417,37 +417,37 @@ sub ElsnerWS_Read($) { $data = $rest; # custom command exec - %specials = ("%NAME" => $name, - "%TYPE" => $hash->{TYPE}, - "%BRIGHTNESS" => $brightness, - "%DATE" => $date, - "%DAYNIGHT" => $twilightFlag, - "%HEMISPHERE" => $hemisphere, - "%ISRAINING" => $isRaining, - "%ISSTORMY" => $isStormy, - "%ISSUNNY" => $isSunny, - "%ISSUNNYEAST" => $isSunnyEast, - "%ISSUNNYSOUTH" => $isSunnySouth, - "%ISSUNNYWEST" => $isSunnyWest, - "%ISWINDY" => $isWindy, - "%LATITUDE" => $latitude, - "%LONGITUDE" => $longitude, - "%SUNAZIMUTH" => $sunAzimuth, - "%SUNEAST" => $sunEast, - "%SUNELAVATION" => $sunElevation, - "%SUNSOUTH" => $sunSouth, - "%SUNWEST" => $sunWest, - "%TEMPERATURE" => $temperature, - "%TIME" => $time, - "%TIMEZONE" => $timeZone, - "%TWILIGHT" => $twilight, - "%WEEKDAY" => $weekday, - "%WINDAVG2MIN" => $windAvg2min, - "%WINDGUST10MIN" => $windGust10min, - "%WINDGUSTCURRNT" => $windGustCurrent, - "%WINDPEAK10MIN" => $windPeak10min, - "%WINDSPEED" => $windSpeed, - "%WINDSTENGTH" => $windStrength); + %specials = ("%NAME" => $name, + "%TYPE" => $hash->{TYPE}, + "%BRIGHTNESS" => $brightness, + "%DATE" => $date, + "%DAYNIGHT" => $twilightFlag, + "%HEMISPHERE" => $hemisphere, + "%ISRAINING" => $isRaining, + "%ISSTORMY" => $isStormy, + "%ISSUNNY" => $isSunny, + "%ISSUNNYEAST" => $isSunnyEast, + "%ISSUNNYSOUTH" => $isSunnySouth, + "%ISSUNNYWEST" => $isSunnyWest, + "%ISWINDY" => $isWindy, + "%LATITUDE" => $latitude, + "%LONGITUDE" => $longitude, + "%SUNAZIMUTH" => $sunAzimuth, + "%SUNEAST" => $sunEast, + "%SUNELAVATION" => $sunElevation, + "%SUNSOUTH" => $sunSouth, + "%SUNWEST" => $sunWest, + "%TEMPERATURE" => $temperature, + "%TIME" => $time, + "%TIMEZONE" => $timeZone, + "%TWILIGHT" => $twilight, + "%WEEKDAY" => $weekday, + "%WINDAVG2MIN" => $windAvg2min, + "%WINDGUST10MIN" => $windGust10min, + "%WINDGUSTCURRNT" => $windGustCurrent, + "%WINDPEAK10MIN" => $windPeak10min, + "%WINDSPEED" => $windSpeed, + "%WINDSTENGTH" => $windStrength); my $customCmdDown = AttrVal($name, "customCmdDown", undef); my $customCmdDownPeriod = AttrVal($name, "customCmdDownPeriod", 'once'); @@ -876,6 +876,13 @@ sub ElsnerWS_Attr(@) { } } } + } elsif ($attrName eq "customCmdPriority") { + if (!defined $attrVal) { + + } elsif ($attrVal !~ m/^down|up$/) { + $err = "attribute-value [$attrName] = $attrVal wrong"; + CommandDeleteAttr(undef, "$name $attrName"); + } } elsif ($attrName eq "signOfLife") { if (!defined $attrVal) { @@ -1019,10 +1026,10 @@ sub ElsnerWS_Shutdown($) {