eslavnov / pylips

Control Philips TVs (2015+) and Ambilight (+ Hue) through their reverse-engineered API (+ MQTT support!)
MIT License
334 stars 58 forks source link

[BUG] set_channel command not working #109

Closed temaoz closed 3 years ago

temaoz commented 3 years ago

Describe the bug How to use the set_channel command? I've seen the documention of the REST API method but can't get it to work.

To Reproduce Steps to reproduce the behavior: Using command python3 /home/pi/pylips/pylips.py --command set_channel --body {"channel":{"ccid":"40005","preset":"5","name":"RTL Television"},"channelList":{"id":"allsat","version":"1"}}

Expected behavior The TV should change to the desired channel, but an error appears.

Screenshots

Additional context

pi@raspberrypi:~/scripts $ python3 /home/pi/pylips/pylips.py --command set_channel --body {"channel":{"ccid":"40005","preset":"5","name":"RTL Television"},"channelList":{"id":"allsat","version":"1"}}
usage: pylips.py [-h] [--host HOST] [--user USER] [--pass PASSWORD]
                 [--command COMMAND] [--path PATH] [--body BODY]
                 [--verbose VERBOSE] [--apiv APIV] [--config CONFIG]
pylips.py: error: unrecognized arguments: channel:preset:5 channel:name:RTL Television channelList:id:allsat channelList:version:1

EDIT: Had to wrap the body parameter in single quotes. Now it's working as excepted. Thanks for the handy script!