Skip to content

Commit

Permalink
[HdmiCec] sanity check decode/add some cmd (#3765)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dima73 committed Sep 2, 2023
1 parent 3d561cd commit 928660f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/python/Components/HdmiCec.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

# CEC Version's table
CEC = ["1.1", "1.2", "1.2a", "1.3", "1.3a", "1.4", "2.0?", "unknown"]

cmdList = {
0x00: "<Polling Message>",
0x04: "<Image View On>",
Expand Down Expand Up @@ -46,6 +47,10 @@
0x9d: "<Inactive Source>",
0x9e: "<CEC Version>",
0x9f: "<Get CEC Version>",
0xa0: "<Vendor Command With ID>",
0xa1: "<Clear External Timer>",
0xa2: "<Set External Timer>",
0xff: "<Abort>"
}

config.hdmicec = ConfigSubsection()
Expand Down Expand Up @@ -218,7 +223,10 @@ def sendMessage(self, address, message):
cmd = 0x8f

if cmd:
data = data.decode()
try:
data = data.decode("UTF-8")
except:
data = data.decode("ISO-8859-1")
if config.hdmicec.minimum_send_interval.value != "0":
self.queue.append((address, cmd, data))
if not self.wait.isActive():
Expand Down Expand Up @@ -456,7 +464,10 @@ def keyEvent(self, keyCode, keyEvent):
if keyCode == 115 or keyCode == 114 or keyCode == 113:
cmd = 0x45
if cmd:
data = data.decode()
try:
data = data.decode("UTF-8")
except:
data = data.decode("ISO-8859-1")
if config.hdmicec.minimum_send_interval.value != "0":
self.queueKeyEvent.append((self.volumeForwardingDestination, cmd, data))
repeat = int(config.hdmicec.volume_forwarding_repeat.value)
Expand Down

0 comments on commit 928660f

Please sign in to comment.