-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added check for MQTT broker addon and updated docs.
- Loading branch information
Showing
6 changed files
with
20 additions
and
10 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
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 was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,16 @@ | ||
#!/usr/bin/env bashio | ||
set -e | ||
|
||
bashio::log.info "Getting mqtt configuration..." | ||
MQTT_HOST=$(bashio::services mqtt "host") | ||
MQTT_USER=$(bashio::services mqtt "username") | ||
MQTT_PASSWORD=$(bashio::services mqtt "password") | ||
if ! bashio::services.available "mqtt"; then | ||
bashio::log.error "No internal MQTT service found. Please install the internal Mosquitto MQTT broker integration." | ||
else | ||
bashio::log.info "Internal MQTT service found, fetching configuration ..." | ||
MQTT_HOST=$(bashio::services mqtt "host") | ||
MQTT_USER=$(bashio::services mqtt "username") | ||
MQTT_PASSWORD=$(bashio::services mqtt "password") | ||
|
||
bashio::log.info "Starting python script..." | ||
python3 ./airthings-mqtt.ha.py --host $MQTT_HOST --username $MQTT_USER --password $MQTT_PASSWORD --config /data/options.json | ||
bashio::log.info "Starting python script..." | ||
python3 ./airthings-mqtt.ha.py --host $MQTT_HOST --username $MQTT_USER --password $MQTT_PASSWORD --config /data/options.json | ||
fi | ||
|
||
bashio::log.info "Done." |