Skip to content

Commit

Permalink
Make Eufy Security WS port configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
oischinger committed May 20, 2024
1 parent a229030 commit b98acc5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ url: http://192.168.178.252:8123/local_eufyp2pstream
arch: [amd64, aarch64, i386, armv7]

# https://developers.home-assistant.io/docs/add-ons/configuration
version: 0.1-alpha.9
version: 0.2-beta
slug: eufyp2pstream
init: false
startup: application
panel_icon: mdi:camera-wireless
map: [config, media]
host_network: false
options:
eufy_security_ws_port: 3000
schema:
eufy_security_ws_port: port
ports: { "63336/tcp": 63336, "63337/tcp": 63337, "63338/tcp": 63338 }
2 changes: 1 addition & 1 deletion files/eufyp2pstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ async def on_message(self, message):
async def init_websocket():
ws: EufySecurityWebSocket = EufySecurityWebSocket(
"402f1039-eufy-security-ws",
3000,
sys.argv[1],
aiohttp.ClientSession(),
c.on_open,
c.on_message,
Expand Down
9 changes: 7 additions & 2 deletions files/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
#!/bin/bash
echo "Starting EufyP2PStream"
python3 -u /eufyp2pstream.py
set +u
CONFIG_PATH=/data/options.json

EUFY_WS_PORT=$(jq --raw-output ".eufy_security_ws_port" $CONFIG_PATH)

echo "Starting EufyP2PStream. eufy_security_ws_port is $EUFY_WS_PORT"
python3 -u /eufyp2pstream.py $EUFY_WS_PORT
echo "Exited with code $?"

0 comments on commit b98acc5

Please sign in to comment.