Skip to content

Commit

Permalink
removes multiple attempts to power TV off
Browse files Browse the repository at this point in the history
  • Loading branch information
kdschlosser committed Feb 2, 2019
1 parent e620422 commit b3fe5cd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions samsungctl/remote_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,14 @@ def power(self, value):
TypeOfRemote="SendRemoteKey"
)

while self.power and count < 10:
logger.info("Sending control command: " + str(power_off))
self.send("ms.remote.control", **power_off)
logger.info("Sending control command: " + str(power))
self.send("ms.remote.control", **power)
logger.info("Sending control command: " + str(power))
self.send("ms.remote.control", **power)
logger.info("Sending control command: " + str(power_off))
self.send("ms.remote.control", **power_off)

event.wait(2.0)
while self.power and count < 10:
event.wait(1.0)
count += 1

if count == 10:
logger.info('Unable to power off the TV')
Expand Down

0 comments on commit b3fe5cd

Please sign in to comment.