From 6f53e6e997c9f4647a667bd58b11bc622fa3b47f Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sat, 21 May 2022 01:45:56 +0300 Subject: move local website to homekit's tree --- localwebsite/htdocs/assets/inverter.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 localwebsite/htdocs/assets/inverter.js (limited to 'localwebsite/htdocs/assets/inverter.js') diff --git a/localwebsite/htdocs/assets/inverter.js b/localwebsite/htdocs/assets/inverter.js new file mode 100644 index 0000000..72d985c --- /dev/null +++ b/localwebsite/htdocs/assets/inverter.js @@ -0,0 +1,15 @@ +var Inverter = { + poll: function () { + setInterval(this._tick, 1000); + }, + + _tick: function() { + ajax.get('/inverter/status.ajax') + .then(({response}) => { + if (response) { + var el = document.getElementById('inverter_status'); + el.innerHTML = response.html; + } + }); + } +}; \ No newline at end of file -- cgit v1.2.3