fix default skins for SD skins.
[vuplus_dvbapp] / lib / python / Plugins / SystemPlugins / HDMICEC / plugin.py
index 329c85a..1151ec4 100755 (executable)
@@ -39,7 +39,7 @@ class HdmiCecPlugin(Screen,ConfigListScreen):
                        <widget source="key_yellow" render="Label" position="300,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#a08500" transparent="1" />
                        <widget source="key_blue" render="Label" position="440,0" zPosition="1" size="140,40" font="Regular;20" halign="center" valign="center" foregroundColor="#ffffff" backgroundColor="#18188b" transparent="1" />
 
-                       <widget name="config" zPosition="2" position="10,50" size="580,270" scrollbarMode="showOnDemand" transparent="1" />
+                       <widget name="config" zPosition="2" position="30,50" size="540,270" scrollbarMode="showOnDemand" transparent="1" />
                </screen>
                """
        def __init__(self, session):
@@ -400,21 +400,13 @@ def messageReceived(address, message):
                elif message == 0x46: # request device name
                        address = addresstv
                        cecmessage = setnamemessage
-                       if config.hdmicec.devicename.value == "vuduo":
-                               cecmessagetwo ="VU+ Duo"
-                               cmd = struct.pack('B8s',cecmessage,cecmessagetwo)
-                       elif config.hdmicec.devicename.value == "vusolo":
-                               cecmessagetwo ="VU+ Solo"
-                               cmd = struct.pack('B9s',cecmessage,cecmessagetwo)
-                       elif config.hdmicec.devicename.value == "vuuno":
-                               cecmessagetwo ="VU+ Uno"
-                               cmd = struct.pack('B8s',cecmessage,cecmessagetwo)
-                       elif config.hdmicec.devicename.value == "vuultimo":
-                               cecmessagetwo ="VU+ Ultimo"
-                               cmd = struct.pack('B8s',cecmessage,cecmessagetwo)
-                       else:
+                       name_len = len(config.hdmicec.devicename.value)
+                       if name_len == 0:
                                cecmessagetwo ="VU+"
                                cmd = struct.pack('B4s',cecmessage,cecmessagetwo)
+                       else:
+                               cecmessagetwo = config.hdmicec.devicename.value
+                               cmd = struct.pack('B'+str(name_len+1)+'s',cecmessage,cecmessagetwo)
                        logcmd = "[HDMI-CEC] send cec message %x:%s to %x" % (cecmessage,cecmessagetwo,address)
 
                elif message == 0x85: # request active source