mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 01:06:04 +00:00
Pushsafer: added device name to availableMessages readings (Forum: #59240)
git-svn-id: https://svn.fhem.de/fhem/trunk@12486 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
374e65447d
commit
c21a37f8be
@ -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.
|
||||
- changed: Pushsafer: added devicename to availableMessages reading name
|
||||
- feature: 98_Hyperion: new set toggleMode
|
||||
new attr hyperionToggleModes
|
||||
new german commandref
|
||||
|
@ -364,13 +364,20 @@ sub Pushsafer_Callback($$$)
|
||||
readingsBulkUpdate($hash, "lastSuccess", $1);
|
||||
}
|
||||
|
||||
if($data =~ /available"?\s*:\s*{([^}]+)}/s)
|
||||
if($data =~ /available"?\s*:\s*{(.+)\s*}\s*}\s*$/gcs)
|
||||
{
|
||||
my %devices = map { split(/:/, $_) } map { s/"//g; $_ } split(",", $1);
|
||||
my %devices = grep { defined($_) } map { /^"?(\d+)"?:({.+})$/ ? ($1 => $2) : undef } split(",", $1);
|
||||
|
||||
foreach my $dev (keys %devices)
|
||||
{
|
||||
readingsBulkUpdate($hash, "availableMessages-$dev", $devices{$dev});
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,7 +484,7 @@ sub Pushsafer_Callback($$$)
|
||||
<ul>
|
||||
<li><b>lastSuccess</b> - The last successful status message received by the Pushsafer server</li>
|
||||
<li><b>lastError</b> - The last errur message received by the Pushsafer server</li>
|
||||
<li><b>availableMessages-<i><deviceID></i></b> - The remaining messages that can be send to this device</li>
|
||||
<li><b>availableMessages-<i><device ID></i>-<i><device name></i></b> - The remaining messages that can be send to this device</li>
|
||||
</ul>
|
||||
</ul>
|
||||
=end html
|
||||
@ -574,7 +581,7 @@ sub Pushsafer_Callback($$$)
|
||||
<ul>
|
||||
<li><b>lastSuccess</b> - Die letzte erfolgreiche Statusmeldung vom Pushsafer Server</li>
|
||||
<li><b>lastError</b> - Die letzte Fehlermeldung vom Pushsafer Server</li>
|
||||
<li><b>availableMessages-<i><Geräte-ID></i></b> - Die verbleibende Anzahl an Nachrichten die zu diesem Gerät noch gesendet werden können</li>
|
||||
<li><b>availableMessages-<i><Geräte-ID></i>-<i><Geräte-Name></i></b> - Die verbleibende Anzahl an Nachrichten die zu diesem Gerät noch gesendet werden können</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user