2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-26 04:24:53 +00:00

Pushsafer: fix availableMessages reading (Forum: )

git-svn-id: https://svn.fhem.de/fhem/trunk@21143 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2020-02-07 21:14:03 +00:00
parent 72d7883ce6
commit fe6c30d19a
2 changed files with 3 additions and 14 deletions

@ -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: 70_Pushsafer: fix availableMessages reading
- bugfix: 73_AutoShuttersControl: fix GetAntiFreez
- change: 59_Weather: add wunderground documentation in commandref
- feature mqtt2.template: add speech recognition extensions

@ -364,21 +364,9 @@ sub Pushsafer_Callback($$$)
readingsBulkUpdate($hash, "lastSuccess", $1);
}
if($data =~ /available"?\s*:\s*{(.+)\s*}\s*}\s*$/gcs)
if($data =~ /available"?\s*:\s*(\d+)/gcs)
{
my %devices = grep { defined($_) } map { /^"?(\d+)"?:({.+})$/ ? ($1 => $2) : undef } split(",", $1);
foreach my $dev (keys %devices)
{
if(defined($devices{$dev}) and $devices{$dev} =~ /^{\s*"?([^":]+)"?\s*:\s*"?([^":]+)"?\s*}$/)
{
my ($devname, $available) = ($1, $2);
$devname =~ s/\s+//g;
readingsBulkUpdate($hash, "availableMessages-$dev-$devname", $available);
}
}
readingsBulkUpdate($hash, "availableMessages", $1);
}
readingsEndUpdate($hash, 1);