Package: sfrtvctl
# sfrtvctlpython library which can also be use in command line.Summary==========commands are sent by websocket on port 7682 with sub-protocol lws-bidirectional-protocol.there is multiple kind of data structure depending on kind of commands we went to send.send commands :BUTTONEVENT structure for  classical remote keys (volume, power, ok, return, pause, play, forward, rewind, directionnal keys, num pad)ZAP structure to send a channel number in 1 request.APP structure to launch special function of the decoder (mosaic, tv guide, vod, replay, recording, media center, settings)SETVOLUME structure to set the volumeKEYBOARD structure to type when inside input fieldInfo commands (not yet implemented):GETINFO and GETVERSIONInstallation============sfrtvctl can be installed using `pip <(https://pip.pypa.io/>`_:::# pip install websocket-client# pip install sfrtvctlAlternatively you can clone the Git repository and run:::# python setup.py installIt's possible to use the command line tool without installation:::$ python -m sfrtvctlBUTTONEVENT============BUTTONEVENT take a second argument to specify the key pressed and a third in case you specify NUM.the table here resume each possible actions for BUTTONEVENT :| Key Pressed (second argument)  | Description                                      || ------------------------------ | -------------------------                        || VUP                            | Volume up                                        || VDOWN                          | Volume Down                                      || RIGHT                          | multidirectionnal right                          || LEFT                           | multidirectionnal left                           || UP                             | multidirectionnal up                             || DOWN                           | multidirectionnal down                           || PUP                            | Program up                                       || PDOWN                          | Program down                                     || INFO                           | Current program info                             || RETURN                         | return key                                       || OK                             | OK key                                           || NUMBER                         | a digit key. take a third argument for the digit || PLAYPAUSE                      | play or pause key                                || FORWARD                        | fast forward key                                 || REWIND                         | fast rewind  key                                 || MUTE                           | mute sound key                                   || POWER                          | power on/off key                                 |in command line mode here is an example of command :```sfrtvctl --host 192.168.1.100  BUTTONEVENT VUP``` # increase volume```sfrtvctl --host 192.168.1.100  BUTTONEVENT NUMBER 1``` # type 1 on num pad (will change channel if watching tv)ZAP====ZAP command is simple, it just take a number as second argument.in command line mode here is an example of command :```sfrtvctl --host 192.168.1.100  ZAP 180``` # will go to channel 180APP===| Command       | Description                       || ------------- | --------------------------------- || MOSAIC        | Mosaique                          || TVGUIDE       | Guide TV                          || VOD           | SFR Play                          || REPLAY        | TV replay                         || RECORDING     | List recorded shows               || MEDIACENTER   | media center (usb, network media) || SETTINGS      | Decoder settings                  |in command line mode here is an example of command :```sfrtvctl --host 192.168.1.100  MOSAIC``` # will display mosaiqueSETVOLUME==========SETVOLUME command is simple, it just take a number between 1 and 100 as second argument to set volume.in command line mode here is an example of command :```sfrtvctl --host 192.168.1.100  SETVOLUME 40``` # will set volume to 40KEYBOARD=========will send keyboard data. This command has a special character to start search which you can send by passing SEARCH as a second argument. To start typing you must send first VALUE and then a third argument.| Command       | Description                              || ------------- | ---------------------------------------- || SEARCH        | Start search                             || VALUE         | send keyboard key pass in third argument |in command line mode here is an example of command :```sfrtvctl --host 192.168.1.100  SEARCH``` # will start search```sfrtvctl --host 192.168.1.100  VALUE a``` # will type a in an input fieldLibrary usage=============sfrtvctl can be imported as a Python 3 library:.. code-block:: pythonimport sfrtvctlA context managed remote controller object of class ``Remote`` can beconstructed using the ``with`` statement:.. code-block:: pythonwith sfrtvctl.Remote(config) as remote:# Use the remote objectThe constructor takes a configuration dictionary as a parameter. Allconfiguration items must be specified.| Key     | Type   | Description                                 ||---------|--------|---------------------------------------------|| host    | string | Hostname or IP address of the decoder.      || port    | int    | TCP port number. (Default: ``7682``)        || timeout | int    | Timeout in seconds. ``0`` means no timeout. |The ``Remote`` object is very simple and you only need the ``control(key, arg1, arg2)``method. See tables above for more details about commands you can pass. You can call ``control`` multiple timesusing the same ``Remote`` object. The connection is automatically closed whenexiting the ``with`` statement.