mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-22 08:11:44 +00:00
55_GDS - added: readings a_onset_local, a_expires_local
git-svn-id: https://svn.fhem.de/fhem/trunk@5778 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
de31655f1f
commit
559874b46a
@ -553,6 +553,8 @@ sub decodeCAPData($$){
|
|||||||
$readings{a_onset} = $alertsXml->{info}[$info]{onset};
|
$readings{a_onset} = $alertsXml->{info}[$info]{onset};
|
||||||
$readings{a_expires} = $alertsXml->{info}[$info]{expires};
|
$readings{a_expires} = $alertsXml->{info}[$info]{expires};
|
||||||
$readings{a_valid} = checkCAPValid($readings{a_expires});
|
$readings{a_valid} = checkCAPValid($readings{a_expires});
|
||||||
|
$readings{a_onset_local} = capTrans($readings{a_onset});
|
||||||
|
$readings{a_expires_local} = capTrans($readings{a_expires});
|
||||||
|
|
||||||
# text informations
|
# text informations
|
||||||
$readings{a_headline} = $alertsXml->{info}[$info]{headline};
|
$readings{a_headline} = $alertsXml->{info}[$info]{headline};
|
||||||
@ -614,6 +616,20 @@ sub checkCAPValid($){
|
|||||||
return $valid;
|
return $valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub capTrans($) {
|
||||||
|
my ($t) = @_;
|
||||||
|
my $valid = 0;
|
||||||
|
my $offset = _calctz(time,localtime(time))*3600; # used from 99_SUNRISE_EL
|
||||||
|
$t =~ s/T/ /;
|
||||||
|
$t =~ s/\+/ \+/;
|
||||||
|
$t = time_str2num($t);
|
||||||
|
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($t+$offset);
|
||||||
|
$mon += 1;
|
||||||
|
$year += 1900;
|
||||||
|
$t = sprintf "%02s.%02s.%02s %02s:%02s:%02s\n", $mday, $mon, $year, $hour, $min, $sec;
|
||||||
|
return $t;
|
||||||
|
}
|
||||||
|
|
||||||
sub findCAPWarnCellId($$){
|
sub findCAPWarnCellId($$){
|
||||||
my ($info, $area) = @_;
|
my ($info, $area) = @_;
|
||||||
my $i = 0;
|
my $i = 0;
|
||||||
@ -1124,6 +1140,8 @@ sub initDropdownLists($){
|
|||||||
#
|
#
|
||||||
# 2014-02-26 added attribute gdsPassiveFtp
|
# 2014-02-26 added attribute gdsPassiveFtp
|
||||||
#
|
#
|
||||||
|
# 2014-05-07 added readings a_onset_local & a_expires_local
|
||||||
|
#
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
#
|
#
|
||||||
# Further informations
|
# Further informations
|
||||||
|
Loading…
x
Reference in New Issue
Block a user