项目作者: pablomenino

项目描述 :
elgato-pi-deck - Is a puthon script to control Elgato Stream Deck and send actions to elgato-pi-deck-server.
高级语言: Python
项目地址: git://github.com/pablomenino/elgato-pi-deck.git
创建时间: 2020-08-12T23:07:50Z
项目社区:https://github.com/pablomenino/elgato-pi-deck

开源协议:GNU General Public License v3.0

下载


GitHub release
GitHub license
GitHub last commit
GitHub repo size
Contributors
GitHub followers
Twitter Follow

Welcome to elgato-pi-deck 👋





🏠 Homepage


elgato-pi-deck - Is a python script to control Elgato Stream Deck and send actions to elgato-pi-deck-server.


Table of contents

How it works" class="reference-link"> How it works

elgato-pi-deck - Is a python script to control Elgato Stream Deck and send actions to elgato-pi-deck-server.

How to Use" class="reference-link">How to Use

Requirements

  • Python 3
  • Raspbian or Raspberry PI OS
  • python3-pip
  • python3-setuptools
  • libudev-dev
  • libusb-1.0-0-dev
  • libhidapi-libusb0
  • libjpeg-dev
  • zlib1g-dev
  • Pillow => 7.1.2
  • streamdeck => 0.8.1
  • wakeonlan => 1.1.6
  • wheel => 0.32.3

Install packages:

  1. sudo apt install -y python3-pip python3-setuptools
  2. sudo apt install -y libudev-dev libusb-1.0-0-dev libhidapi-libusb0
  3. sudo apt install -y libjpeg-dev zlib1g-dev

Install Python packages:

  1. sudo pip3 install wheel
  2. sudo pip3 install pillow
  3. sudo pip3 install streamdeck
  4. sudo pip3 install wakeonlan

Usage

This guide is intended to help you to configure the script parameters (config.json) and software.

For this example elgato-pi-deck are be installed on Raspberry Pi (This is only an example):

Clone this repo in /opt

  1. cd /opt
  2. sudo git clone https://github.com/pablomenino/elgato-pi-deck/
  3. cd /opt/elgato-pi-deck/

Install:

  1. sudo ./install.sh

Yo can assign new butons editing the configuration file.

Example config:

  1. {
  2. "info": "elgato-pi-deck",
  3. "version": "0.9",
  4. "FONT_SRC": "Roboto-Regular.ttf",
  5. "FONT_SIZE": "16",
  6. "PANEL_SELECT": "0",
  7. "PANEL_BRIGHTNESS": "30",
  8. "PANEL_BRIGHTNESS_STEP": "10",
  9. "deck_poweron": "True",
  10. "panel0":
  11. [
  12. {
  13. "type": "gotopanel",
  14. "name": "Apps",
  15. "gotopanelid": "1",
  16. "image": "icons/utilities.png",
  17. "image_pressed": "icons/utilities-pressed.png"
  18. },
  19. {
  20. "type": "gotopanel",
  21. "name": "IoT",
  22. "gotopanelid": "2",
  23. "image": "icons/iot.png",
  24. "image_pressed": "icons/iot.png"
  25. },
  26. {
  27. "type": "wakeonlan",
  28. "name": "NAS",
  29. "image": "icons/1618plus.png",
  30. "image_pressed": "icons/1618plus.png",
  31. "nodename": "NAS",
  32. "nodeip": "192.168.0.22",
  33. "nodemac": "00:FF:AA:FF:AA:BB"
  34. },
  35. {
  36. "type": "bright0",
  37. "name": "Bright 0%",
  38. "image": "icons/brightness-0.png",
  39. "image_pressed": "icons/brightness-0.png"
  40. },
  41. {
  42. "type": "brightless",
  43. "name": "Bright -",
  44. "image": "icons/brightness-less.png",
  45. "image_pressed": "icons/brightness-less.png"
  46. },
  47. {
  48. "type": "brightmore",
  49. "name": "Bright +",
  50. "image": "icons/brightness-more.png",
  51. "image_pressed": "icons/brightness-more.png"
  52. },
  53. {
  54. "type": "bright100",
  55. "name": "Bright 100%",
  56. "image": "icons/brightness-100.png",
  57. "image_pressed": "icons/brightness-100.png"
  58. }
  59. ],
  60. "panel1":
  61. [
  62. {
  63. "type": "gotopanel",
  64. "name": "Back To Main Panel",
  65. "gotopanelid": "0",
  66. "image": "icons/back.png",
  67. "image_pressed": "icons/back-pressed.png"
  68. },
  69. {
  70. "type": "action",
  71. "name": "Firefox",
  72. "image": "icons/firefox.png",
  73. "image_pressed": "icons/firefox.png",
  74. "action": "firefox",
  75. "serverip": "192.168.0.10",
  76. "serverport": "8889"
  77. }
  78. ],
  79. "panel2":
  80. [
  81. {
  82. "type": "gotopanel",
  83. "name": "Back To Main",
  84. "gotopanelid": "0",
  85. "image": "icons/back.png",
  86. "image_pressed": "icons/back-pressed.png"
  87. },
  88. {
  89. "type": "webhook",
  90. "name": "Ligth CPU",
  91. "image": "icons/ligth.png",
  92. "image_pressed": "icons/ligth.png",
  93. "webhookurl": "http://192.168.0.48/api/webhook/200"
  94. }
  95. ]
  96. }

Config info:

You can change the font and size (edit config.json):

  1. "FONT_SRC": "Roboto-Regular.ttf",
  2. "FONT_SIZE": "16",

You can add new fonts to Assets/fonts directory.

You can select wath panel to load at start up:

  1. "PANEL_SELECT": "0",

Set the initial screen brightness:

  1. "PANEL_BRIGHTNESS": "30",

This example set the screen brightness to 30%

Set display on/off in start up:

  1. "deck_poweron": "True",

By default is always on.

Defaults buttons

The script assign the last key in panel (panel0) to power on/power off display.

You have severals type of buttons:

  • blank (blank button)
  1. "type": "blank",
  2. "name": "",
  3. "image": "icons/utilities.png",
  4. "image_pressed": "icons/utilities-pressed.png"

name: name to display.

Images path is in the Assets folder

  • gotopanel (select this to change the selected panel)
  1. "type": "gotopanel",
  2. "name": "Apps",
  3. "gotopanelid": "1",
  4. "image": "icons/utilities.png",
  5. "image_pressed": "icons/utilities-pressed.png"

name: name to display.

gotopanelid: is the panel id to change.

Images path is in the Assets folder

  • wakeonlan (To send wake on lan packet to node)
  1. "type": "wakeonlan",
  2. "name": "NAS",
  3. "image": "icons/1618plus.png",
  4. "image_pressed": "icons/1618plus.png",
  5. "nodename": "NAS",
  6. "nodeip": "192.168.0.22",
  7. "nodemac": "00:FF:AA:FF:AA:BB"

name: node name

nodeip: device ip address to check if alive

nodemac: device mac address

Images path is in the Assets folder

  • bright0 (Set brightness to 0%)
  1. "type": "bright0",
  2. "name": "Bright 0%",
  3. "image": "icons/brightness-0.png",
  4. "image_pressed": "icons/brightness-0.png"
  • brightless (Lower brightness level)
  1. "type": "brightless",
  2. "name": "Bright -",
  3. "image": "icons/brightness-less.png",
  4. "image_pressed": "icons/brightness-less.png"
  • brightmore (Up brightness level)
  1. "type": "brightmore",
  2. "name": "Bright +",
  3. "image": "icons/brightness-more.png",
  4. "image_pressed": "icons/brightness-more.png"
  • bright100 (Set brightness to 100%)
  1. "type": "bright100",
  2. "name": "Bright 100%",
  3. "image": "icons/brightness-100.png",
  4. "image_pressed": "icons/brightness-100.png"
  • action (To send an action to server)
  1. "type": "action",
  2. "name": "Firefox",
  3. "image": "icons/firefox.png",
  4. "image_pressed": "icons/firefox.png",
  5. "action": "firefox",
  6. "serverip": "192.168.0.10",
  7. "serverport": "8889"

name: name to display

action: action to be executed on remote server

serverip: server ip address

serverport: server port

  • webhook (post action to execute a webhook)
  1. "type": "webhook",
  2. "name": "Ligth CPU",
  3. "image": "icons/ligth.png",
  4. "image_pressed": "icons/ligth.png",
  5. "webhookurl": "http://192.168.0.48/api/webhook/200"

name: name to display
webhookurl: webhook address

In case to unisntall:

  1. sudo ./uninstall.sh

Support me:" class="reference-link">Support me:

Librepay

Donate using Liberapay

Paypal

paypal

Third party:" class="reference-link">Third party: