mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
57_Calendar.pm: make ical file work again
git-svn-id: https://svn.fhem.de/fhem/trunk@17384 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bf57cf6b6a
commit
9ac6456453
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 57_Calendar.pm: make ical file work again
|
||||
- change: 34_ESPEasy: get/set cmd handling rewritten, more supported ESP
|
||||
Easy cmds, user defined cmds/mappings, nfx plugin handling
|
||||
changed (Forum #91353)
|
||||
|
@ -2525,6 +2525,7 @@ sub Calendar_ProcessUpdate($$$) {
|
||||
my $name = $hash->{NAME};
|
||||
my $removeall = $param->{removeall};
|
||||
my $t= $param->{t};
|
||||
my $type= $hash->{".fhem"}{type};
|
||||
|
||||
if(exists($hash->{".fhem"}{subprocess})) {
|
||||
Log3 $hash, 2, "Calendar $name: update in progress, process aborted.";
|
||||
@ -2537,12 +2538,31 @@ sub Calendar_ProcessUpdate($$$) {
|
||||
|
||||
delete($hash->{".fhem"}{iCalendar});
|
||||
|
||||
my $httpresponsecode= $param->{code};
|
||||
|
||||
if($errmsg) {
|
||||
Log3 $name, 1, "Calendar $name: retrieval failed with error message $errmsg";
|
||||
readingsSingleUpdate($hash, "state", "error ($errmsg)", 1);
|
||||
} else {
|
||||
if($type eq "url") {
|
||||
if($httpresponsecode != 200) {
|
||||
$errmsg= "retrieval failed with HTTP response code $httpresponsecode";
|
||||
Log3 $name, 1, "Calendar $name: $errmsg";
|
||||
readingsSingleUpdate($hash, "state", "error ($errmsg)", 1);
|
||||
Log3 $name, 5, "Calendar $name: HTTP response header:\n" .
|
||||
$param->{httpheader};
|
||||
} else {
|
||||
Log3 $name, 5, "Calendar $name: HTTP response code $httpresponsecode";
|
||||
readingsSingleUpdate($hash, "state", "retrieved", 1);
|
||||
}
|
||||
} elsif($type eq "file") {
|
||||
Log3 $name, 5, "Calendar $name: file retrieval successful";
|
||||
readingsSingleUpdate($hash, "state", "retrieved", 1);
|
||||
} else {
|
||||
# this case never happens by virtue of _Define, so just
|
||||
die "Software Error";
|
||||
}
|
||||
}
|
||||
|
||||
if($errmsg or !defined($ics) or ("$ics" eq "") ) {
|
||||
Log3 $hash, 1, "Calendar $name: retrieved no or empty data";
|
||||
@ -2824,7 +2844,8 @@ sub Calendar_UpdateCalendar($$) {
|
||||
#
|
||||
# and same SEQUENCE
|
||||
#
|
||||
if($v0->sameValue($v, "LAST-MODIFIED")) {
|
||||
if($v0->sameValue($v, "LAST-MODIFIED") &&
|
||||
$v0->sameValue($v, "DTSTAMP")) {
|
||||
#
|
||||
# is not modified
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user