]> git.etc.gen.nz Git - mythtv-status.git/commitdiff
The XML since r20037 contains some additional states, cater for them.
authorMarc Tousignant <drayson@net1plus.com>
Tue, 31 Mar 2009 06:47:33 +0000 (19:47 +1300)
committerAndrew Ruthven <andrew@etc.gen.nz>
Tue, 31 Mar 2009 06:47:33 +0000 (19:47 +1300)
From Marc:

OK, not good.

From my research, I am on ProtoVer 44 which was switched at 19978.
The changes to State went in at 20037, well after the switch to 44.
I am currently on 20281.

Not looking like we can use ProtoVer as the versioning check atm.

Marc

So we'll pretend that protocol version 44 is when the change happened.

bin/mythtv-status

index 921f54509f5d78283a19f7e627eff843644d4ae0..fa816d56dd350881d04b5c2b35fc173ff92b1dd9 100755 (executable)
@@ -192,10 +192,11 @@ my @blocks = (
     'name'  => 'Encoders',
     'type'  => 'xpath',
     'xpath' => "//Status/Encoders/Encoder",
+    'protocol_version' => [ "<= 43" ],
     'attrs' => [ qw/hostname id state connected/ ],
     'template' => "__hostname__ (__id__) - __state____connected__",
     'rewrite' => {
-      '/connected/' => { '1' => '', '0' => ' (Disconnected)' },
+      '/connected/' => { '1' => '', '0' => "${warning}(Disconnected)${normal}" },
       '/state/' => {
         '^0$' => "${safe}Idle${normal}",
         '^1$' => "${warning}Watching LiveTV${normal}",
@@ -205,6 +206,28 @@ my @blocks = (
       }
   },
 
+  # Info about the encoders.
+  {
+    'name'  => 'Encoders',
+    'type'  => 'xpath',
+    'xpath' => "//Status/Encoders/Encoder",
+    'protocol_version' => [ ">= 44" ],
+    'attrs' => [ qw/hostname id state connected/ ],
+    'template' => "__hostname__ (__id__) - __state____connected__",
+    'rewrite' => {
+      '/connected/' => { '1' => '', '0' => "${warning}(Disconnected)${normal}" },
+      '/state/' => {
+         '^-1$' => "${warning}Error${normal}",
+         '^0$' => "${safe}Idle${normal}",
+         '^1$' => "${warning}Watching LiveTV${normal}",
+         '^2$' => "${warning}Watching Pre-recorded${normal}",
+         '^3$' => "${warning}Watching DVD${normal}",
+         '^4$' => "${warning}Watching Video${normal}",
+         '^5$' => "${warning}Watching Recording${normal}",
+         '^6$' => "${warning}Recording${normal}" },
+    }
+  },
+
   # What programs (if any) are being recorded right now?
   {
     'name'  => 'Recording Now',