From 3eddfd5ba8e721ea7204574708871767cf3b0e5a Mon Sep 17 00:00:00 2001 From: Squandor Date: Mon, 16 Jan 2017 14:44:59 +0100 Subject: [PATCH] Fix for setpoints can use float numbers now #65 --- static/js/domoboard.js | 6 +++--- templates/switches.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/js/domoboard.js b/static/js/domoboard.js index ebaeac6..204bffd 100644 --- a/static/js/domoboard.js +++ b/static/js/domoboard.js @@ -178,9 +178,9 @@ function setpointSlider(updateSetpoints, block) { $.each(updateSetpoints, function(i, setpoint) { url = "/api?type=devices&rid=" + setpoint[0]; requestAPI(url, function(d) { - var percentage = parseInt(JSON.parse(d).result[0].Data); - $('#setpoint_slider' + setpoint[0] + "_block_" + block).slider({min:parseInt(setpoint[1]), max:parseInt(setpoint[2]), value: percentage}).on('slideStop', function(ev) { - changeSetpoint(setpoint[0], ev.value); + var percentage = parseFloat(JSON.parse(d).result[0].Data); + $('#setpoint_slider' + setpoint[0] + "_block_" + block).slider({min:parseInt(setpoint[1]), max:parseInt(setpoint[2]), value: parseFloat(percentage)}).on('slideStop', function(ev) { + changeSetpoint(setpoint[0], parseFloat(ev.value)); } ).data('slider'); $('#stpnt_' + setpoint[0] + "_block_" + block + '_track').css({'background-image': '-webkit-linear-gradient(top, #f9f9f9 0%, red 100%)', 'background-image': '-o-linear-gradient(top, #f9f9f9 0%, red 100%)', 'background-image': 'linear-gradient(to bottom, #f9f9f9 0%, red 100%)'}); }); diff --git a/templates/switches.html b/templates/switches.html index b5bf493..0c49ce0 100644 --- a/templates/switches.html +++ b/templates/switches.html @@ -44,7 +44,7 @@ {% elif "setpoint_slider" in v[2] %} - + {% elif "rgb" in v[2] %}