summaryrefslogtreecommitdiffstats
path: root/src/js/fan_speed.js
diff options
context:
space:
mode:
authorHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-07-05 14:21:47 +0200
committerHumberto Alfonso Díaz <humberto.alfonso@asvito.es>2019-07-05 14:21:47 +0200
commite1cbac3034100e26ff02ee6c094fde16b90337cf (patch)
tree04538c586f042fb63c8f77cef28ed5dfcac3cb81 /src/js/fan_speed.js
parent286ee56101e1538e8cca0b23032332a8f4d686f2 (diff)
OPT Improve chair and fan code
Diffstat (limited to 'src/js/fan_speed.js')
-rw-r--r--src/js/fan_speed.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/js/fan_speed.js b/src/js/fan_speed.js
index cc81fe0..4c8349e 100644
--- a/src/js/fan_speed.js
+++ b/src/js/fan_speed.js
@@ -1,10 +1,13 @@
-module.exports = {
- set: function(value) {
- document.getElementById('FanSpeedProgress').value = value;
- document.getElementById('FanSpeedInput').value = value;
- },
- update: function( value ) {
- this.set(value);
+var value = 0;
+
+function update(node, value) {
+ node.value = value;
+ node.parentNode.getElementsByTagName('progress')[0].value = value;
+}
+module.exports = {
+ set: function(node) {
+ value = node.value;
+ update(node, value);
}
} \ No newline at end of file