summaryrefslogtreecommitdiff
path: root/localwebsite/htdocs/assets/inverter.js
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-05-21 01:45:56 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-05-21 01:45:56 +0300
commit6f53e6e997c9f4647a667bd58b11bc622fa3b47f (patch)
tree226bd65a04576de4f41bf8396af97cd43ca27829 /localwebsite/htdocs/assets/inverter.js
parent902a3bfbe2c4645e6725fb7583500d1a28026fad (diff)
move local website to homekit's tree
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