-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Adds support for Home Assistant integration discovery (#15)
* ✨ Adds support for Home Assistant integration discovery * 👕 Addresses linting warnings
- Loading branch information
Showing
4 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/with-contenv bashio | ||
# ============================================================================== | ||
# Community Hass.io Add-ons: AdGuard Home | ||
# Sends discovery information to Home Assistant. | ||
# ============================================================================== | ||
declare config | ||
declare payload | ||
|
||
config=$(\ | ||
bashio::var.json \ | ||
host "$(bashio::addon.ip_address)" \ | ||
port "^$(bashio::addon.ingress_port)" \ | ||
) | ||
|
||
payload=$(\ | ||
bashio::var.json \ | ||
service adguard \ | ||
config "^${config}" \ | ||
) | ||
|
||
if bashio::api.hassio "POST" "/discovery" "${payload}"; then | ||
bashio::log.info "Successfully send discovery information to Home Assistant." | ||
else | ||
bashio::log.error "Discovery message to Home Assistant failed!" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters