danielperna84 / hass-configurator

Configuration UI for Home Assistant
MIT License
305 stars 168 forks source link

Feature Request: Open file by URL #95

Closed OttoWinter closed 6 years ago

OttoWinter commented 6 years ago

Hi, first of all thanks for this absolutely awesome add-on!

I myself am developing another add-on for HassIO (an esphomeyaml HassIO add-on). The add-on will require users to edit YAML configuration files too, like with Home Assistant. These YAML configuration files (stored under /config/esphomeyaml/... and therefore already accessible by Hass Configurator) are compiled into binaries and uploaded to a device and it's all controlled from a simple web interface.

Because navigating to this path (for example /config/esphomeyaml/livingroom.yaml) is not a perfect UX, ideally I think it would be great if I could create a cross-link to Hass Configurator like http://hassio.local:3218/config/esphomeyaml/livingroom.yaml :)

Please excuse me if this already possible, I wasn't able to find such a feature using the limited search I just did of this repo.

danielperna84 commented 6 years ago

Currently this is not possible. I'll think about it. The way you imagine it won't be possible because of how webservers work, and implementing a rounting that only handles this isn't worth the effort. Instead there could be something like ...3218/load?p=/config/esphomeyaml/livingroom.yaml, so with the prepended load?p=. But I'm not sure how well the slashes will be transported to the webserver.

danielperna84 commented 6 years ago

I have added this functionality in the new version. The way this is used is by appending /?loadfile=/path/to/file to the base URL of the configurator. So for example https://192.168.1.123:3218/?loadfile=/home/homeassistant/.homeassistant/configuration.yaml. The hass.io addon is not yet updated though. So keep an eye on that.

OttoWinter commented 6 years ago

Awesome! Thanks so much! I will try to integrate it as soon as possible