pbkhrv / rtl_433-hass-addons

Collection of Home Assistant add-ons that use rtl_433
240 stars 109 forks source link

Ensure template has an EOL character when rendering #81 #96

Closed deviantintegral closed 2 years ago

deviantintegral commented 2 years ago

Summary

Fixes #81 .

Alternatives Considered

We could use sed for this as well, but that seems more complicated. There's no harm in an extra blank line for the case where the file contains it like normal.

Testing Steps

  1. Remove the trailing newline from a configuration file: https://stackoverflow.com/questions/1050640/how-to-stop-vim-from-adding-a-newline-at-end-of-file
  2. Run the addon with the config file.
  3. It should work instead of erroring out parsing the configuration.