Commit Graph

7 Commits

Author SHA1 Message Date
Christian Ferbar
c7dadabb7b
fix web_server javascript when in strict mode / local files (#2270) 2022-11-05 23:27:19 -07:00
Keilin Bickar
7fd533fe17
Add lock component documentation (#1867)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-04 07:24:35 +13:00
Jesse Hills
25152e2f54
Add number setting to web_server (#1804) 2022-01-17 12:32:10 +13:00
Jesse Hills
07f7b2147f
Make button entities work on webserver (#1719) 2021-12-13 10:30:36 +13:00
Kamil Trzciński
3fc8a57e80
Expose select on Frontend web_server: (#1445) 2021-09-13 10:07:32 +02:00
Andrew Zaborowski
7be6c6536a
Add webserver-v1.js click handlers for Cover buttons (#521)
Add js click handlers for the web UI buttons added in
b1f9c9a6e0a3dce73507e6b60782987ee2459f48 in the esphome repository.
Since this change doesn't make the .js file incompatible with esphome
versions before the referenced commit I guess there's no need to
rename the file to -v2.

There are probably better ways to write those click handlers, for
example we could have a common function to launch the POST request to a
URL that it reads from the button object like this:

var button_onclick = function(evt) {
    const xhr = new XMLHttpRequest();
    xhr.open("POST", evt.target.onlick_post_url, true);
    xhr.send();
};

row.children[2].children[0].addEventListener('click', button_onlick);
row.children[2].children[0].onclick_post_url = '/light/' + id.substr(6) + '/toggle';

The only problem with this is that iirc ``evt.target`` is
browser-specific.
2020-04-09 11:12:21 -03:00
Otto Winter
07ddde788c
Initial commit 🎉 2018-05-13 11:37:02 +02:00