mirror of
https://github.com/hassio-addons/addon-motioneye.git
synced 2025-05-05 03:31:22 +00:00
Add Home Assistant integration discovery
This commit is contained in:
parent
926dcb610c
commit
f0cb073db0
2 changed files with 24 additions and 0 deletions
21
motioneye/rootfs/etc/services.d/motioneye/discovery
Executable file
21
motioneye/rootfs/etc/services.d/motioneye/discovery
Executable file
|
@ -0,0 +1,21 @@
|
||||||
|
#!/usr/bin/with-contenv bashio
|
||||||
|
# ==============================================================================
|
||||||
|
# Home Assistant Community Add-on: motionEye
|
||||||
|
# Send Discovery information to Home Assistant
|
||||||
|
# ==============================================================================
|
||||||
|
declare config
|
||||||
|
|
||||||
|
# Wait for motionEye to start before continuing
|
||||||
|
bashio::net.wait_for 28765
|
||||||
|
|
||||||
|
# Create discovery config payload for Home Assistant
|
||||||
|
config=$(bashio::var.json \
|
||||||
|
url "http://127.0.0.1:28765"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Send discovery info
|
||||||
|
if bashio::discovery "mmotioneye" "${config}" > /dev/null; then
|
||||||
|
bashio::log.info "Successfully send discovery information to Home Assistant."
|
||||||
|
else
|
||||||
|
bashio::log.error "Discovery message to Home Assistant failed!"
|
||||||
|
fi
|
|
@ -15,5 +15,8 @@ if bashio::debug; then
|
||||||
options+=(-d)
|
options+=(-d)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Send out discovery information
|
||||||
|
./discovery &
|
||||||
|
|
||||||
# Run the motionEye
|
# Run the motionEye
|
||||||
exec meyectl startserver "${options[@]}"
|
exec meyectl startserver "${options[@]}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue