From 6af233354bdf42918b45a4a79831c8e54173300f Mon Sep 17 00:00:00 2001 From: manuel Date: Wed, 25 Dec 2013 22:17:56 +0100 Subject: add updateValue-trigger --- htdocs/webiopi.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'htdocs') diff --git a/htdocs/webiopi.js b/htdocs/webiopi.js index f893618..568bbb0 100644 --- a/htdocs/webiopi.js +++ b/htdocs/webiopi.js @@ -211,9 +211,12 @@ WebIOPi.prototype.addALT = function (alt, gpio, name) { } WebIOPi.prototype.updateValue = function (gpio, value) { + old_value = w().GPIO[gpio].value w().GPIO[gpio].value = value; var style = (value == 1) ? "HIGH" : "LOW"; $("#gpio"+gpio).attr("class", style); + if (old_value != value) + $("#gpio"+gpio).trigger("updateValue", [ gpio, old_value, value ]) } WebIOPi.prototype.updateFunction = function (gpio, func) { -- cgit v1.2.3