From 037e621a990746a243c62c8d0638f6130fea8df5 Mon Sep 17 00:00:00 2001 From: vbs <> Date: Sun, 17 Nov 2019 14:29:36 +0000 Subject: [PATCH] 70_KODI: pad channel and channelgroup readings with zeros to improve alphabetical ordering git-svn-id: https://svn.fhem.de/fhem/trunk@20527 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/70_KODI.pm | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 0aee9c774..138305a03 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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, diff --git a/fhem/FHEM/70_KODI.pm b/fhem/FHEM/70_KODI.pm index a18f3b3dc..614039195 100644 --- a/fhem/FHEM/70_KODI.pm +++ b/fhem/FHEM/70_KODI.pm @@ -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); }