Skip to content

Commit

Permalink
Added check for MQTT broker addon and updated docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjmccans committed Apr 9, 2022
1 parent 8ce5af6 commit 1513d92
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.0.1] - 2022-04-08
### Fixes
* Updated documentation and added check for Mosquitto MQTT broker addon requirement.


## [1.0.0] - 2022-02-13
### New
* Support for battery and illuminance sensors for Airthings Wave+ devices pulled from upstream.
Expand Down
2 changes: 2 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This Home Assistant Add-on will read sensor values from [Airthings](https://www.

In order to use this add-on you need:

* The [Mosquitto Broker Add-on](https://github.com/home-assistant/addons/tree/master/mosquitto) installed

* An Airthings Wave, Airthings Wave Plus or Airthings Wave Mini

* A Raspberry Pi 3/4 with built-in Bluetooth or a Bluetooth adapter that supports Bluetooth Low Energy (BLE) (such as [this one](https://www.amazon.com/Plugable-Bluetooth-Adapter-Compatible-Raspberry/dp/B009ZIILLI)).
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The screenshot below shows an Airthings Wave Plus device as it appears in Home A

In order to use this add-on you need:

* The [Mosquitto Broker Add-on](https://github.com/home-assistant/addons/tree/master/mosquitto) installed

* An Airthings Wave, Airthings Wave Plus or Airthings Wave Mini

* A Raspberry Pi 3/4 with built-in Bluetooth or a Bluetooth adapter that supports Bluetooth Low Energy (BLE) (such as [this one](https://www.amazon.com/Plugable-Bluetooth-Adapter-Compatible-Raspberry/dp/B009ZIILLI)).
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Airthings
version: 1.0.0
version: 1.0.1
slug: airthings
description: Read sensor values from Airthings Wave environmental monitoring devices
url: https://github.com/mjmccans/hassio-addon-airthings
Expand Down
3 changes: 0 additions & 3 deletions src/run-local.sh

This file was deleted.

16 changes: 10 additions & 6 deletions src/run.sh
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."

0 comments on commit 1513d92

Please sign in to comment.