{ "info": { "author": "Chris Simons", "author_email": "chris@simonsmail.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: No Input/Output (Daemon)", "License :: OSI Approved :: BSD License", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3.6", "Topic :: Games/Entertainment" ], "description": "\n# cecdaemon - CEC Daemon for linux media centers\n\n`cecdaemon` is for managing the [Consumer Electronics Control (CEC)](https://en.wikipedia.org/wiki/Consumer_Electronics_Control) capabilities of your linux media center. Some embedded systems (like Raspberry Pi) have native support for CEC. Many video cards do not have CEC capabilities, so you may need an adapter like the [one offered by PulseEight](https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter) to use CEC with your computer.\n\nCurrently it is able to translate remote buttons to computer input, run shell commands, and set the device name, and run shell scripts on standby and wake.\n\n## Requirements:\n\n- [python-cec](https://github.com/trainman419/python-cec/)\n- [python-uinput](https://github.com/tuomasjjrasanen/python-uinput)\n\n## Installation:\nInstallation should be done as root to allow installing commands to `/usr/bin/`\n\n### Install from PIP\n```\n# pip3 install cecdaemon\n```\n\n### Install using setuptools\n```\n# python3 setup.py install\n```\n\n## Configuration\n`cecdaemon` looks for a configuration file at /etc/cecdaemon.conf. The configuration file is a simple .ini style file. There are currently three main sections that can be configured:\n\nThe **[tv]** section allows you to set the name that will be displayed on the tv for your device. It is truncated to the 14 character max.\n```\n[tv]\nname = HTPC\n```\nThe **[keymap]** section allows you to map CEC user command codes to uinput events. The remote codes can be determined using the `cecusercodes` command. The command will output the CEC User Command name, and the code in both hex and decimal. The hex code matches the CEC Specification, the decimal code is what is used in the config for readability.\n\n```\n# /usr/bin/cecusercodes\nInitializing CEC, please wait...\nIf this takes too long ensure the device is not already in use\nCEC device initialized, press remote keys or hit ^C to quit\nSelect pressed (hex: 0x0, dec: 0)\nUp pressed (hex: 0x1, dec: 1)\nDown pressed (hex: 0x2, dec: 2)\nLeft pressed (hex: 0x3, dec: 3)\nRight pressed (hex: 0x4, dec: 4)\nF1 (Blue) pressed (hex: 0x71, dec: 113)\nF2 (Red) pressed (hex: 0x72, dec: 114)\nF3 (Green) pressed (hex: 0x73, dec: 115)\nF4 (Yellow) pressed (hex: 0x74, dec: 116)\n^C\n```\nKeypresses can be found in [python-uinput ev.py file](https://github.com/tuomasjjrasanen/python-uinput/blob/master/src/ev.py). The format for assigning a key to a cec code looks like this:\n\n```\n[keymap]\n0 = KEY_ENTER\n1 = KEY_UP\n#STOP\n69 = KEY_X\n70 = KEY_PAUSE\n113 = KEY_BLUE\n```\nThe CEC Specification states that only Select, Directions, Exit, Numbers and Function Keys get forwarded to devices, but the actual implementation varies between vendors. The `cecdaemon.conf-example` file comes with a good baseline that works well with Kodi and Steam.\n\n\nThe **[cmd_**_name_**]** sections can be used to run shell commands when a button is pressed or held down. For a simple press set the holdtime to 1. Use a separate section for each command. Remember to use the absolute path for the command if you are unsure what the PATH environment variable will be for the daemon. A command hook currently overrides any uinput keypresses.\n\n```\n[cmd_reboot]\n# Reboots when holding the red button for 400ms\nkey = 114\nholdtime = 4000\ncommand = /usr/bin/systemctl reboot\n\n[cmd_switcher]\n# Open the task switcher\nkey = 115\nholdtime = 1\ncommand =/usr/local/scripts/switcher\n```\n\nThe **[triggers]** section can be used to run shell commands when the daemon receives events such as standby or wake. \n```\n[triggers]\nstandby = /usr/bin/systemctl stop hyperiond\nwake = /usr/bin/systemctl start hyperiond\n```\n## Usage\n\n### Running from the command line\n```\n# cecdaemon --help\nusage: cecdaemon [-h] [-d] [-v] [-c FILE]\n\noptional arguments:\n -h, --help show this help message and exit\n -d, --debug Print debug messages\n -v, --verbose Print verbose messages\n -c FILE, --config FILE\n Configuration file\n#\n```\n\n### Using the included systemd service\nCopy the script to the systemd directory:\n```\n# cp examples/cecdaemon.service-example /etc/systemd/system/cecdaemon.service\n```\nReload the daemons and start the service:\n`# systemctl daemon-reload`\n`# systemctl start cecdaemon`\n\nAnd to enable the service use:\n`# systemctl enable cecdaemon`\n\nViewing the stderr and stdout for troubleshooting:\n`# journalctl -f -u cecdaemon`\n### Using in another python script\n```\n>>> from cecdaemon import cecdaemon\n>>> cecdaemon.run()\n```\n\n\n## Changelog\n1.0.0 - Initial beta release\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/simons-public/cecdaemon", "keywords": "libcec cec daemon htpc", "license": "", "maintainer": "", "maintainer_email": "", "name": "cecdaemon", "package_url": "https://pypi.org/project/cecdaemon/", "platform": "", "project_url": "https://pypi.org/project/cecdaemon/", "project_urls": { "Homepage": "https://github.com/simons-public/cecdaemon" }, "release_url": "https://pypi.org/project/cecdaemon/1.0.0/", "requires_dist": [ "cec", "python-uinput" ], "requires_python": "", "summary": "Daemon and tools for managing CEC capabilities", "version": "1.0.0" }, "last_serial": 4300039, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "dd17988a90edcc2f02de7c347686a8da", "sha256": "61d96b92847b456b8d6ba4875057864ddc35c5b575798e55e9d3217e585e9b42" }, "downloads": -1, "filename": "cecdaemon-1.0.0-py3.7.egg", "has_sig": false, "md5_digest": "dd17988a90edcc2f02de7c347686a8da", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 21814, "upload_time": "2018-09-22T16:46:58", "url": "https://files.pythonhosted.org/packages/04/c0/e2705ef5ebd345c63520703e6668724a3e94133e9e6806b26e3958137e54/cecdaemon-1.0.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "ced3864535cf476b507dbef047c8672d", "sha256": "cb9f291124097a61cbd2782f004ce9d6190b31454d787e73e8af42081728cb6b" }, "downloads": -1, "filename": "cecdaemon-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ced3864535cf476b507dbef047c8672d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13011, "upload_time": "2018-09-22T16:46:57", "url": "https://files.pythonhosted.org/packages/36/8e/1632536a631e3339dc55e4bc5ab588074517265afce39375359e33fa24cd/cecdaemon-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8da4549bc887a71a71a13e156d556b76", "sha256": "81bb237b9711397dc993af1eeac1b9b6cb03026f59cee4d2df456029115fd406" }, "downloads": -1, "filename": "cecdaemon-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8da4549bc887a71a71a13e156d556b76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10256, "upload_time": "2018-09-22T16:46:59", "url": "https://files.pythonhosted.org/packages/df/10/2c0d638657be0ee547b5e7bf345de40f88158b8541e421c9ff939782f6bd/cecdaemon-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dd17988a90edcc2f02de7c347686a8da", "sha256": "61d96b92847b456b8d6ba4875057864ddc35c5b575798e55e9d3217e585e9b42" }, "downloads": -1, "filename": "cecdaemon-1.0.0-py3.7.egg", "has_sig": false, "md5_digest": "dd17988a90edcc2f02de7c347686a8da", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 21814, "upload_time": "2018-09-22T16:46:58", "url": "https://files.pythonhosted.org/packages/04/c0/e2705ef5ebd345c63520703e6668724a3e94133e9e6806b26e3958137e54/cecdaemon-1.0.0-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "ced3864535cf476b507dbef047c8672d", "sha256": "cb9f291124097a61cbd2782f004ce9d6190b31454d787e73e8af42081728cb6b" }, "downloads": -1, "filename": "cecdaemon-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ced3864535cf476b507dbef047c8672d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13011, "upload_time": "2018-09-22T16:46:57", "url": "https://files.pythonhosted.org/packages/36/8e/1632536a631e3339dc55e4bc5ab588074517265afce39375359e33fa24cd/cecdaemon-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8da4549bc887a71a71a13e156d556b76", "sha256": "81bb237b9711397dc993af1eeac1b9b6cb03026f59cee4d2df456029115fd406" }, "downloads": -1, "filename": "cecdaemon-1.0.0.tar.gz", "has_sig": false, "md5_digest": "8da4549bc887a71a71a13e156d556b76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10256, "upload_time": "2018-09-22T16:46:59", "url": "https://files.pythonhosted.org/packages/df/10/2c0d638657be0ee547b5e7bf345de40f88158b8541e421c9ff939782f6bd/cecdaemon-1.0.0.tar.gz" } ] }