Skip to content

Commit

Permalink
feat: add env variables for mqtt options
Browse files Browse the repository at this point in the history
Refs: #1094
  • Loading branch information
mKeRix committed Mar 10, 2022
1 parent 643f6db commit 57d6a9c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/integrations/home-assistant.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ room-assistant makes use of the [MQTT auto discovery](https://www.home-assistant
| `password` | String | | Password for authentication |
| `rejectUnauthorized` | Boolean | `true` | Whether MQTTS connections should fail for invalid certificates or not. Set this to `false` if you are using a self-signed certificate and connect via TLS. |

Some of these settings may also be configured as environment variables, using `RA_HOME_ASSISTANT_MQTT_URL`, `RA_HOME_ASSISTANT_MQTT_USERNAME` and `RA_HOME_ASSISTANT_MQTT_PASSWORD`.

::: details Example Config

```yaml
Expand Down
2 changes: 2 additions & 0 deletions docs/integrations/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ To get started with your automations based on these topics it is recommended to
| `password` | String | | Password for authentication |
| `rejectUnauthorized` | Boolean | `true` | Whether MQTTS connections should fail for invalid certificates or not. Set this to `false` if you are using a self-signed certificate and connect via TLS. |

Some of these settings may also be configured as environment variables, using `RA_MQTT_MQTT_URL`, `RA_MQTT_MQTT_USERNAME` and `RA_MQTT_MQTT_PASSWORD`.

::: details Example Config

```yaml
Expand Down
10 changes: 10 additions & 0 deletions src/config/definitions/custom-environment-variables.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ global:
apiPort:
__name: RA_GLOBAL_API_PORT
__format: number
homeAssistant:
mqttUrl: RA_HOME_ASSISTANT_MQTT_URL
mqttOptions:
username: RA_HOME_ASSISTANT_MQTT_USERNAME
password: RA_HOME_ASSISTANT_MQTT_PASSWORD
mqtt:
mqttUrl: RA_MQTT_MQTT_URL
mqttOptions:
username: RA_MQTT_MQTT_USERNAME
password: RA_MQTT_MQTT_PASSWORD

0 comments on commit 57d6a9c

Please sign in to comment.