TellStick - Added stdin, clarified desc. and config (#206)

* Added event listener

* Updated version

* Add TellStick Logo

* Update run.sh

* Update config.json

* Update config.json

* Update config.json

* Update config.json

* Variable handling..

* Update run.sh
This commit is contained in:
endor-force
2017-12-04 22:16:46 +01:00
committed by Pascal Vizeli
parent aa02ebf3b9
commit e2e2a76a61
3 changed files with 27 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
{ {
"name": "Tellstick", "name": "TellStick",
"version": "0.1", "version": "0.2",
"slug": "tellstick", "slug": "tellstick",
"description": "Telldus Tellstick daemon and tools.", "description": "TellStick and TellStick Duo service.",
"url": "https://home-assistant.io/addons/tellstick/", "url": "https://home-assistant.io/addons/tellstick/",
"startup": "services", "startup": "services",
"stdin": "true",
"boot": "auto", "boot": "auto",
"devices": ["/dev/bus/usb:/dev/bus/usb:rwm"], "devices": ["/dev/bus/usb:/dev/bus/usb:rwm"],
"options": { "options": {
@@ -16,6 +17,14 @@
"model": "selflearning-switch", "model": "selflearning-switch",
"house": "A", "house": "A",
"unit": "1" "unit": "1"
},
{
"id": 2,
"name": "Example device two",
"protocol": "everflourish",
"model": "selflearning-switch",
"house": "A",
"unit": "2"
} }
] ]
}, },

BIN
tellstick/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -56,11 +56,23 @@ for (( i=0; i < "$DEVICES"; i++ )); do
) >> /etc/tellstick.conf ) >> /etc/tellstick.conf
done done
echo "[Info] Run telldusd & socat" echo "[Info] Exposing sockets and loading service"
# Expose the unix socket to internal network # Expose the unix socket to internal network
socat TCP-LISTEN:50800,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusClient & socat TCP-LISTEN:50800,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusClient &
socat TCP-LISTEN:50801,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusEvents & socat TCP-LISTEN:50801,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusEvents &
# Run telldus-core daemon # Run telldus-core daemon in the background
exec /usr/local/sbin/telldusd --nodaemon < /dev/null exec /usr/local/sbin/telldusd --nodaemon < /dev/null &
# Listen for input to tdtool
echo "[Info] Starting event listener"
while read -r input; do
# removing JSON stuff
input="$(echo "$input" | jq --raw-output '.')"
echo "[Info] Read alias: $input"
if ! msg="$(tdtool --"$input")"; then
echo "[Error] TellStick Command failed -> $msg"
fi
done