mirror of
https://github.com/hassio-addons/addon-home-panel.git
synced 2025-05-04 19:01:21 +00:00
✨ Add discovery init script
This commit is contained in:
parent
a150809b0e
commit
17a033c7d8
1 changed files with 18 additions and 0 deletions
18
home-panel/rootfs/etc/cont-init.d/discovery.sh
Normal file
18
home-panel/rootfs/etc/cont-init.d/discovery.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/with-contenv bashio
|
||||
# ==============================================================================
|
||||
# Community Hass.io Add-ons: Home Panel
|
||||
# Sends discovery information to Home Assistant.
|
||||
# ==============================================================================
|
||||
declare config
|
||||
|
||||
config=$(\
|
||||
bashio::var.json \
|
||||
host "127.0.0.1" \
|
||||
port "^45158" \
|
||||
)
|
||||
|
||||
if bashio::discovery "home_panel" "${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
|
Loading…
Add table
Add a link
Reference in a new issue