mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
57_Calendar: enable gzipped ical files (forum #31845)
git-svn-id: https://svn.fhem.de/fhem/trunk@7509 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
9f01bef0ae
commit
13fabcbd8f
@ -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.
|
||||
- feature: 57_Calendar: enable gzipped ical files (forum #31845)
|
||||
- bugfix: 70_Jabber.pm: XMPP DNS SVR record query added
|
||||
- bugfix: 70_PIONEERAVR: fixed "missed to call readingsBeginUpdate first"
|
||||
- feature: fhemweb.js rewrite based on jQuery, single-widget-implementation
|
||||
|
@ -942,6 +942,17 @@ sub Calendar_GetUpdate($$) {
|
||||
#main::Debug $ical->asString();
|
||||
|
||||
my @entries= @{$ical->{entries}};
|
||||
if($#entries<0) {
|
||||
eval { require Compress::Zlib; };
|
||||
if($@) {
|
||||
Log3 $hash, 1, "Calendar " . $hash->{NAME} . ": Maybe gzip data, but cannot load Compress::Zlib";
|
||||
}
|
||||
else {
|
||||
$ics = Compress::Zlib::memGunzip($ics);
|
||||
$ical->parse(split("\n",$ics));
|
||||
@entries= @{$ical->{entries}};
|
||||
}
|
||||
};
|
||||
if($#entries<0) {
|
||||
Log3 $hash, 1, "Calendar " . $hash->{NAME} . ": Not an ical file at URL";
|
||||
$hash->{STATE}= "Not an ical file at URL";
|
||||
|
Loading…
x
Reference in New Issue
Block a user