Pushsafer: fix availableMessages reading (Forum: #107812)

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

View File

@ -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

View File

@ -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);