hass-configurator
hass-configurator copied to clipboard
Online dependencies
Yesterday had internet outage for a couple hours and wanted to create a binary sensor to ping google and notify me when internet gets back. Unforunately I could not use Configurator because it was trying to load google fonts and something else, and it took forever to load.
TLDR; It would be great if configurator did not have any online dependencies like fonts.
This is related to issue #145 and #73 and has been discussed there already. The readme also states this early at the top:
IMPORTANT: The configurator fetches JavaScript libraries, CSS and fonts from CDNs. Hence it does NOT work when your client device is offline. And it is only available for Python 3.
It is more than just fonts. Here is a branch where I started implementing this by including most of the libraries. But with the AceExplorer it's a ton of files that would have to be included, and in the current state the included webserver isn't capatble of delivering the files at the structure the AceEditor expects them. So even though I could get part of this offline, the main library (the editor) is a problem that causes a lot of work. Whoever feels the need to implement his can freely do so and create a PR once done. As mentioned before, I've done it already for CSS etc., so there's a rough guideline how it could be done.
I now have applied the changes from the branch mentioned above into the current devel-branch. So at least some files will by served locally due to the change. Not included is the Ace Editor and the CSS/fonts of materialize. Serving those with my primitive implementation wont's work without modifying the libraries, and for that I'm too lazy. But with my latest commit it should be easier for someone else to take care of that.
@danielperna84 I think than moving to offline support is a good decision. I just wanted to ask why you use Ace Editor? Home Assistant is using Codemirror.
@Misiu Because I have created the configurator long before Home Assistant had text editing capability, and back then Ace Editor seemed to be a good choice. It was easy to implement and did it's job.
I just hit this issue too. I have 3rd party scripts blocked by default, and the editor both fails to work and has no error feedback.
The entire point of homeassistant is to not rely on cloud anything. I was extremely surprised anything depends on files served from anywhere on the internet.
Indeed : the file-editor wont work unless it can access CloudFlare. One of the main reasons I opted for HA is that everything is local and secure and won't halt if the house goes offline. So I am disappointed about the need to access CloudFlare. Furthermore it is not an elegant failure : it just refuses to access/open the file, there is no error message that states "hey I cant access cloudflare"
+1 to the above. HA keeps pushing it self as the no cloud solution yet when it actually comes to there being no cloud it fails and features that dont really need cloud outright break