Skip to content

Commit

Permalink
Remove empty responses for smarthub inputs
Browse files Browse the repository at this point in the history
Empty "reponse" members were causing random input values to be selected
when input query received no response.  Get rid of them and update
matching logic to handle missing response values.

This partially fixes #11 -- now the behavior is at least consistent.
  • Loading branch information
eklundjon committed Apr 21, 2018
1 parent 5710532 commit e393786
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Samsung Ex-Link.indigoPlugin/Contents/Server Plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ def actionControlUniversal(self, action, dev):
"response" : [0x04, 0x00, 0x00, 0xf1, 0x59, 0x00, 0x00, 0xb6]
},
"NETFLIX" : { "command" : [0x08, 0x22, 0x0d, 0x00, 0x00, 0xF3, 0xD6]
"response" : [] #netflix sends the generic smarthub response
#netflix sends the generic smarthub response
},
"AMAZON" : { "command" : [0x08, 0x22, 0x0d, 0x00, 0x00, 0xF4, 0xD5],
"response" : [] #amazon sends the generic smarthub response
"AMAZON" : { "command" : [0x08, 0x22, 0x0d, 0x00, 0x00, 0xF4, 0xD5]
#amazon sends the generic smarthub response
}
#I'm not sure why Netflix and Amazon are so special, but my TV doesn't have
#direct access to any other smarthub apps. Perhaps newer TVs do.
Expand Down Expand Up @@ -866,7 +866,7 @@ def isPowerOn(self, dev):
def updateInput(self, dev):
reply = self.sendQuery(dev, "INPUT")
for input in self.inputs:
if bytearray(reply[-8:]) == bytearray(self.inputs[input]["response"]):
if self.inputs[input].get("response") is not None and bytearray(reply[-8:]) == bytearray(self.inputs[input]["response"]):
self.logger.info(dev.name+": Active input is "+input)
dev.updateStateOnServer("input", input)
return
Expand Down

0 comments on commit e393786

Please sign in to comment.