Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: Add ability for mqtt_relay to use a config file #3013

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

gdt
Copy link
Collaborator

@gdt gdt commented Jul 29, 2024

examples: Add ability for mqtt_relay to use a config file

This commit adds the ability to read config values from
rtl_433_mqtt_relay.yaml (overriding defaults). This read is skipped
if the yaml module can't be loaded or the config file can't be read,
so those without PyYAML or a config file see no change.

Those with a config file can set parameters for address/port to listen
for json-in-sylog, MQTT credentials, whether to post individual
values, a json dictionary, or both.

While rudimentary, this is a huge functional improvement, allowing
those using TLS and broker passwords (as arguably all should be) to
use the script without modifying it.

This commit adds the ability to read config values from
rtl_433_mqtt_relay.yaml (overriding defaults).  This read is skipped
if the yaml module can't be loaded or the config file can't be read,
so those without PyYAML or a config file see no change.

Those with a config file can set parameters for address/port to listen
for json-in-sylog, MQTT credentials, whether to post individual
values, a json dictionary, or both.

While rudimentary, this is a huge functional improvement, allowing
those using TLS and broker passwords (as arguably all should be) to
use the script without modifying it.
@gdt gdt changed the title rtl_433_mqtt_relay: Support reading config from a file examples: Add ability for mqtt_relay to use a config file Jul 29, 2024
@gdt
Copy link
Collaborator Author

gdt commented Jul 30, 2024

This ran well overnight on three machines (1 mac and 2 Linux), so I am changing from 'this is a draft' to "I would like to merge this'.

@zuckschwerdt
Copy link
Collaborator

LGTM, thanks!

@gdt gdt merged commit d3975a4 into merbanan:master Jul 30, 2024
8 checks passed
@gdt gdt deleted the feature.relay-config branch July 30, 2024 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants