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 2bc8d29eb4
commit 6143c10a97
3 changed files with 27 additions and 6 deletions

View File

@@ -1,10 +1,11 @@
{
"name": "Tellstick",
"version": "0.1",
"name": "TellStick",
"version": "0.2",
"slug": "tellstick",
"description": "Telldus Tellstick daemon and tools.",
"description": "TellStick and TellStick Duo service.",
"url": "https://home-assistant.io/addons/tellstick/",
"startup": "services",
"stdin": "true",
"boot": "auto",
"devices": ["/dev/bus/usb:/dev/bus/usb:rwm"],
"options": {
@@ -16,6 +17,14 @@
"model": "selflearning-switch",
"house": "A",
"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
done
echo "[Info] Run telldusd & socat"
echo "[Info] Exposing sockets and loading service"
# Expose the unix socket to internal network
socat TCP-LISTEN:50800,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusClient &
socat TCP-LISTEN:50801,reuseaddr,fork UNIX-CONNECT:/tmp/TelldusEvents &
# Run telldus-core daemon
exec /usr/local/sbin/telldusd --nodaemon < /dev/null
# Run telldus-core daemon in the background
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