summaryrefslogtreecommitdiff
path: root/localwebsite/htdocs/assets/inverter.js
diff options
context:
space:
mode:
Diffstat (limited to 'localwebsite/htdocs/assets/inverter.js')
-rw-r--r--localwebsite/htdocs/assets/inverter.js15
1 files changed, 15 insertions, 0 deletions
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