70_KODI: pad channel and channelgroup readings with zeros to improve alphabetical ordering

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@20527 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vbs 2019-11-17 14:29:36 +00:00
parent 69b37c2ac6
commit cd164a3731
2 changed files with 4 additions and 2 deletions

View File

@ -1,5 +1,7 @@
# 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: 70_KODI: pad channel and channelgroup readings with zeros to
improve alphabetical ordering
- bugfix: 73_AutoShuttersControl: fix incompatibilities with older perl
version
- feature: 93_DbLog: new attribute defaultMinInterval,

View File

@ -813,7 +813,7 @@ sub KODI_ProcessResponse($$)
Log3($name, 4, "$name: KODI_ProcessResponse: received channelgroups information");
readingsBeginUpdate($hash);
foreach my $cg (@{$obj->{result}->{channelgroups}}) {
my $cgid = $cg->{channelgroupid};
my $cgid = sprintf("%03d", $cg->{channelgroupid});
readingsBulkUpdate($hash, "channelgroup_${cgid}_type", $cg->{channeltype});
readingsBulkUpdate($hash, "channelgroup_${cgid}_label", $cg->{label});
@ -826,7 +826,7 @@ sub KODI_ProcessResponse($$)
readingsBeginUpdate($hash);
foreach my $c (@{$obj->{result}->{channels}}) {
my $cid = $c->{channelid};
readingsBulkUpdate($hash, "channel_${cid}", $c->{label});
readingsBulkUpdate($hash, "channel_" . sprintf("%03d", $cid), $c->{label});
}
readingsEndUpdate($hash, 1);
}