From f98ee137cfd9e377b9878c329e1dd87a5c107843 Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <andrew@etc.gen.nz>
Date: Tue, 13 Nov 2018 00:10:18 +1300
Subject: [PATCH] Allow showing device type in the encoder output

Original patch is from Eric Wilde, but made some assumptions that wouldn't
scale. Let's try this which is more general.
---
 bin/mythtv-status | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/bin/mythtv-status b/bin/mythtv-status
index 2dc99ab..8cf3417 100755
--- a/bin/mythtv-status
+++ b/bin/mythtv-status
@@ -291,8 +291,8 @@ my @blocks = (
     'type'  => 'xpath',
     'xpath' => "//Status/Encoders/Encoder",
     'protocol_version' => [ ">= 58" ],
-    'attrs' => [ qw/hostname id state connected/ ],
-    'template' => "__hostname__ (__id__) - __state____connected__",
+    'attrs' => [ qw/hostname id state devlabel connected/ ],
+    'template' => "__hostname__ (__id____devtype__) - __state____connected__",
     'rewrite' => {
       '/connected/' => { '1' => '', '0' => "${warning}(Disconnected)${normal}" },
       '/state/' => {
@@ -309,6 +309,12 @@ my @blocks = (
     'filter' => {
       'state' => sub { return $c->{'encoder_skip_idle'} && $_[0] == 0 },
     },
+    'subs' => {
+      'devtype' => sub {
+        if    ($_[0]->{'devlabel'} =~ /\[ (.+) :/)   { ", $1" }
+        else { '' }
+      },
+    },
   },
 
   # What programs (if any) are being recorded right now?
-- 
2.30.2