forked from home-assistant/addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add matter server discovery (home-assistant#2746)
* Add matter server discovery * Update changelog * Fix discovery script location * Rename discovery script
- Loading branch information
1 parent
6256222
commit c8baf75
Showing
4 changed files
with
33 additions
and
2 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
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
18 changes: 18 additions & 0 deletions
18
matter_server/rootfs/etc/s6-overlay/scripts/matter-server-discovery
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,18 @@ | ||
#!/usr/bin/with-contenv bashio | ||
# ============================================================================== | ||
# Send matter discovery information to Home Assistant | ||
# ============================================================================== | ||
declare ha_config | ||
|
||
# Prepare discovery payload | ||
ha_config=$(\ | ||
bashio::var.json \ | ||
host "$(hostname)" \ | ||
port "^5580" \ | ||
) | ||
|
||
if bashio::discovery "matter" "${ha_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 |