2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

99_SUNRISE_EL.pm: Log missing attribute (Forum #112281)

git-svn-id: https://svn.fhem.de/fhem/trunk@22216 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2020-06-20 19:06:47 +00:00
parent 24d99189cd
commit 2df50a0804
2 changed files with 11 additions and 2 deletions

View File

@ -3214,11 +3214,11 @@ FW_devState($$@)
$txt = $v if(defined($v));
} elsif(!$dsi && $allSets =~ m/\bdesired-temp:/) {
$txt = "$1 °C" if($txt =~ m/^measured-temp: (.*)/); # FHT fix
$txt = "$1 °C" if($txt =~ m/^measured-temp: (.*)/);
$cmdList = "desired-temp" if(!$cmdList);
} elsif(!$dsi && $allSets =~ m/\bdesiredTemperature:/) {
$txt = ReadingsVal($d, "temperature", ""); # ignores stateFormat!!!
$txt = ReadingsVal($d, "temperature", "");
$txt =~ s/ .*//;
$txt .= "°C";
$cmdList = "desiredTemperature" if(!$cmdList);

View File

@ -35,6 +35,15 @@ sub
SUNRISE_EL_Initialize($)
{
my ($hash) = @_;
InternalTimer(1, sub() {
my $long = AttrVal("global", "longitude", undef);
my $lat = AttrVal("global", "latitude", undef);
if(( defined($long) && !defined($lat)) ||
(!defined($long) && defined($lat))) {
Log 1, "SUNRISE: set both longitude and latitude or none of them";
}
}, undef);
}