@ -20,18 +20,18 @@ var useCCT = false;
var now = 0 ;
var now = 0 ;
var ago = 0 ;
var ago = 0 ;
<!-- removeIf ( ! rfm69 ) -- >
//removeIf(!rfm69)
var packets ;
var packets ;
var filters = [ ] ;
var filters = [ ] ;
<!-- endRemoveIf ( ! rfm69 ) -- >
//endRemoveIf(!rfm69)
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
var Magnitudes = [ ] ;
var Magnitudes = [ ] ;
var MagnitudeErrors = { } ;
var MagnitudeErrors = { } ;
var MagnitudeNames = { } ;
var MagnitudeNames = { } ;
var MagnitudeTypePrefixes = { } ;
var MagnitudeTypePrefixes = { } ;
var MagnitudePrefixTypes = { } ;
var MagnitudePrefixTypes = { } ;
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Messages
// Messages
@ -417,7 +417,7 @@ function moduleVisible(module) {
$ ( ".module-" + module ) . css ( "display" , "inherit" ) ;
$ ( ".module-" + module ) . css ( "display" , "inherit" ) ;
}
}
<!-- removeIf ( ! thermostat ) -- >
//removeIf(!thermostat)
function checkTempRangeMin ( ) {
function checkTempRangeMin ( ) {
var min = parseInt ( $ ( "#tempRangeMinInput" ) . val ( ) , 10 ) ;
var min = parseInt ( $ ( "#tempRangeMinInput" ) . val ( ) , 10 ) ;
var max = parseInt ( $ ( "#tempRangeMaxInput" ) . val ( ) , 10 ) ;
var max = parseInt ( $ ( "#tempRangeMaxInput" ) . val ( ) , 10 ) ;
@ -440,7 +440,7 @@ function doResetThermostatCounters(ask) {
"Are you sure you want to reset burning counters?" ;
"Are you sure you want to reset burning counters?" ;
return doAction ( question , "thermostat_reset_counters" ) ;
return doAction ( question , "thermostat_reset_counters" ) ;
}
}
<!-- endRemoveIf ( ! thermostat ) -- >
//endRemoveIf(!thermostat)
function initSelectGPIO ( select ) {
function initSelectGPIO ( select ) {
// TODO: properly lock used GPIOs via locking and apply the mask here
// TODO: properly lock used GPIOs via locking and apply the mask here
@ -806,7 +806,7 @@ function doDebugClear() {
return false ;
return false ;
}
}
<!-- removeIf ( ! rfm69 ) -- >
//removeIf(!rfm69)
function doClearCounts ( ) {
function doClearCounts ( ) {
sendAction ( "clear-counts" , { } ) ;
sendAction ( "clear-counts" , { } ) ;
@ -854,7 +854,7 @@ function doClearFilters() {
return false ;
return false ;
}
}
<!-- endRemoveIf ( ! rfm69 ) -- >
//endRemoveIf(!rfm69)
function delParent ( ) {
function delParent ( ) {
var parent = $ ( this ) . parent ( ) . parent ( ) ;
var parent = $ ( this ) . parent ( ) . parent ( ) ;
@ -897,7 +897,7 @@ function createRelayList(data, container, template_name) {
}
}
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
function createMagnitudeList ( data , container , template_name ) {
function createMagnitudeList ( data , container , template_name ) {
var current = $ ( "#" + container + " > div" ) . length ;
var current = $ ( "#" + container + " > div" ) . length ;
@ -916,7 +916,7 @@ function createMagnitudeList(data, container, template_name) {
}
}
}
}
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// RPN Rules
// RPN Rules
@ -950,7 +950,7 @@ function addRPNTopic() {
// RFM69
// RFM69
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! rfm69 ) -- >
//removeIf(!rfm69)
function addMapping ( ) {
function addMapping ( ) {
var template = $ ( "#nodeTemplate .pure-g" ) [ 0 ] ;
var template = $ ( "#nodeTemplate .pure-g" ) [ 0 ] ;
@ -964,7 +964,7 @@ function addMapping() {
line . appendTo ( "#mapping" ) ;
line . appendTo ( "#mapping" ) ;
}
}
<!-- endRemoveIf ( ! rfm69 ) -- >
//endRemoveIf(!rfm69)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Wifi
// Wifi
@ -1238,7 +1238,7 @@ function initRelayConfig(data) {
// Sensors & Magnitudes
// Sensors & Magnitudes
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
function initMagnitudes ( data ) {
function initMagnitudes ( data ) {
// check if already initialized (each magnitude is inside div.pure-g)
// check if already initialized (each magnitude is inside div.pure-g)
@ -1267,13 +1267,13 @@ function initMagnitudes(data) {
}
}
}
}
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Curtains
// Curtains
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! curtain ) -- >
//removeIf(!curtain)
//Create the controls for one curtain. It is called when curtain is updated (so created the first time)
//Create the controls for one curtain. It is called when curtain is updated (so created the first time)
//Let this there as we plan to have more than one curtain per switch
//Let this there as we plan to have more than one curtain per switch
@ -1323,13 +1323,13 @@ function initCurtainConfig(data) {
) ;
) ;
}
}
<!-- endRemoveIf ( ! curtain ) -- >
//endRemoveIf(!curtain)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Lights
// Lights
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! light ) -- >
//removeIf(!light)
// wheelColorPicker accepts:
// wheelColorPicker accepts:
// hsv(0...360,0...1,0...1)
// hsv(0...360,0...1,0...1)
@ -1476,13 +1476,13 @@ function initChannels(num) {
} ) ;
} ) ;
}
}
<!-- endRemoveIf ( ! light ) -- >
//endRemoveIf(!light)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// RFBridge
// RFBridge
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! rfbridge ) -- >
//removeIf(!rfbridge)
function rfbLearn ( ) {
function rfbLearn ( ) {
var parent = $ ( this ) . parents ( ".pure-g" ) ;
var parent = $ ( this ) . parents ( ".pure-g" ) ;
@ -1519,13 +1519,13 @@ function addRfbNode() {
return line ;
return line ;
}
}
<!-- endRemoveIf ( ! rfbridge ) -- >
//endRemoveIf(!rfbridge)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// LightFox
// LightFox
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
<!-- removeIf ( ! lightfox ) -- >
//removeIf(!lightfox)
function lightfoxLearn ( ) {
function lightfoxLearn ( ) {
sendAction ( "lightfoxLearn" , { } ) ;
sendAction ( "lightfoxLearn" , { } ) ;
@ -1562,7 +1562,7 @@ function initLightfox(data, relayCount) {
$ ( ".button-lightfox-clear" ) . off ( "click" ) . click ( lightfoxClear ) ;
$ ( ".button-lightfox-clear" ) . off ( "click" ) . click ( lightfoxClear ) ;
}
}
<!-- endRemoveIf ( ! lightfox ) -- >
//endRemoveIf(!lightfox)
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Processing
// Processing
@ -1613,7 +1613,7 @@ function processData(data) {
// RFBridge
// RFBridge
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! rfbridge ) -- >
//removeIf(!rfbridge)
if ( "rfbCount" === key ) {
if ( "rfbCount" === key ) {
for ( i = 0 ; i < data . rfbCount ; i ++ ) { addRfbNode ( ) ; }
for ( i = 0 ; i < data . rfbCount ; i ++ ) { addRfbNode ( ) ; }
@ -1637,26 +1637,26 @@ function processData(data) {
return ;
return ;
}
}
<!-- endRemoveIf ( ! rfbridge ) -- >
//endRemoveIf(!rfbridge)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// LightFox
// LightFox
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! lightfox ) -- >
//removeIf(!lightfox)
if ( "lightfoxButtons" === key ) {
if ( "lightfoxButtons" === key ) {
initLightfox ( data [ "lightfoxButtons" ] , data [ "lightfoxRelayCount" ] ) ;
initLightfox ( data [ "lightfoxButtons" ] , data [ "lightfoxRelayCount" ] ) ;
return ;
return ;
}
}
<!-- endRemoveIf ( ! lightfox ) -- >
//endRemoveIf(!lightfox)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// RFM69
// RFM69
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! rfm69 ) -- >
//removeIf(!rfm69)
if ( key == "packet" ) {
if ( key == "packet" ) {
var packet = data . packet ;
var packet = data . packet ;
@ -1696,7 +1696,7 @@ function processData(data) {
return ;
return ;
}
}
<!-- endRemoveIf ( ! rfm69 ) -- >
//endRemoveIf(!rfm69)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// RPN Rules
// RPN Rules
@ -1748,7 +1748,7 @@ function processData(data) {
// Curtains
// Curtains
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! curtain ) -- >
//removeIf(!curtain)
function applyCurtain ( a , b ) {
function applyCurtain ( a , b ) {
$ ( "#curtainGetPicture" ) . css ( 'background' , 'linear-gradient(' + a + ', black ' + b + '%, #a0d6ff ' + b + '%)' ) ;
$ ( "#curtainGetPicture" ) . css ( 'background' , 'linear-gradient(' + a + ', black ' + b + '%, #a0d6ff ' + b + '%)' ) ;
@ -1790,13 +1790,13 @@ function processData(data) {
}
}
return ;
return ;
}
}
<!-- endRemoveIf ( ! curtain ) -- >
//endRemoveIf(!curtain)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Lights
// Lights
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! light ) -- >
//removeIf(!light)
if ( "rgb" === key ) {
if ( "rgb" === key ) {
initColor ( { rgb : true } ) ;
initColor ( { rgb : true } ) ;
@ -1844,13 +1844,13 @@ function processData(data) {
useCCT = value ;
useCCT = value ;
}
}
<!-- endRemoveIf ( ! light ) -- >
//endRemoveIf(!light)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Sensors & Magnitudes
// Sensors & Magnitudes
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
{
{
var position = key . indexOf ( "Correction" ) ;
var position = key . indexOf ( "Correction" ) ;
@ -1924,7 +1924,7 @@ function processData(data) {
return ;
return ;
}
}
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// WiFi
// WiFi
@ -1993,7 +1993,7 @@ function processData(data) {
// Curtain(s)
// Curtain(s)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
<!-- removeIf ( ! curtain ) -- >
//removeIf(!curtain)
// Relay configuration
// Relay configuration
if ( "curtainConfig" === key ) {
if ( "curtainConfig" === key ) {
@ -2001,7 +2001,7 @@ function processData(data) {
return ;
return ;
}
}
<!-- endRemoveIf ( ! curtain ) -- >
//endRemoveIf(!curtain)
@ -2047,12 +2047,12 @@ function processData(data) {
}
}
// Domoticz - Magnitudes
// Domoticz - Magnitudes
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
if ( "dczMagnitudes" === key ) {
if ( "dczMagnitudes" === key ) {
createMagnitudeList ( value , "dczMagnitudes" , "dczMagnitudeTemplate" ) ;
createMagnitudeList ( value , "dczMagnitudes" , "dczMagnitudeTemplate" ) ;
return ;
return ;
}
}
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Thingspeak
// Thingspeak
@ -2065,12 +2065,12 @@ function processData(data) {
}
}
// Thingspeak - Magnitudes
// Thingspeak - Magnitudes
<!-- removeIf ( ! sensor ) -- >
//removeIf(!sensor)
if ( "tspkMagnitudes" === key ) {
if ( "tspkMagnitudes" === key ) {
createMagnitudeList ( value , "tspkMagnitudes" , "tspkMagnitudeTemplate" ) ;
createMagnitudeList ( value , "tspkMagnitudes" , "tspkMagnitudeTemplate" ) ;
return ;
return ;
}
}
<!-- endRemoveIf ( ! sensor ) -- >
//endRemoveIf(!sensor)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// HTTP API
// HTTP API
@ -2153,11 +2153,11 @@ function processData(data) {
var days = uptime ;
var days = uptime ;
value = days + "d " + zeroPad ( hours , 2 ) + "h " + zeroPad ( minutes , 2 ) + "m " + zeroPad ( seconds , 2 ) + "s" ;
value = days + "d " + zeroPad ( hours , 2 ) + "h " + zeroPad ( minutes , 2 ) + "m " + zeroPad ( seconds , 2 ) + "s" ;
}
}
<!-- removeIf ( ! thermostat ) -- >
//removeIf(!thermostat)
if ( "tmpUnits" == key ) {
if ( "tmpUnits" == key ) {
$ ( "span.tmpUnit" ) . html ( data [ key ] == 3 ? "ºF" : "ºC" ) ;
$ ( "span.tmpUnit" ) . html ( data [ key ] == 3 ? "ºF" : "ºC" ) ;
}
}
<!-- endRemoveIf ( ! thermostat ) -- >
//endRemoveIf(!thermostat)
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Matching
// Matching
@ -2349,7 +2349,7 @@ $(function() {
$ ( "#uploader" ) . on ( "change" , onFileUpload ) ;
$ ( "#uploader" ) . on ( "change" , onFileUpload ) ;
$ ( ".button-upgrade" ) . on ( "click" , doUpgrade ) ;
$ ( ".button-upgrade" ) . on ( "click" , doUpgrade ) ;
<!-- removeIf ( ! garland ) -- >
//removeIf(!garland)
$ ( ".checkbox-garland-enable" ) . on ( "change" , function ( ) {
$ ( ".checkbox-garland-enable" ) . on ( "change" , function ( ) {
sendAction ( "garland_switch" , { status : $ ( this ) . prop ( "checked" ) ? 1 : 0 } ) ;
sendAction ( "garland_switch" , { status : $ ( this ) . prop ( "checked" ) ? 1 : 0 } ) ;
} ) ;
} ) ;
@ -2365,11 +2365,11 @@ $(function() {
$ ( ".button-garland-set-default" ) . on ( "click" , function ( ) {
$ ( ".button-garland-set-default" ) . on ( "click" , function ( ) {
sendAction ( "garland_set_default" , { } ) ;
sendAction ( "garland_set_default" , { } ) ;
} ) ;
} ) ;
<!-- endRemoveIf ( ! garland ) -- >
//endRemoveIf(!garland)
<!-- removeIf ( ! thermostat ) -- >
//removeIf(!thermostat)
$ ( ".button-thermostat-reset-counters" ) . on ( 'click' , doResetThermostatCounters ) ;
$ ( ".button-thermostat-reset-counters" ) . on ( 'click' , doResetThermostatCounters ) ;
<!-- endRemoveIf ( ! thermostat ) -- >
//endRemoveIf(!thermostat)
$ ( ".button-apikey" ) . on ( "click" , generateAPIKey ) ;
$ ( ".button-apikey" ) . on ( "click" , generateAPIKey ) ;
$ ( ".button-upgrade-browse" ) . on ( "click" , function ( ) {
$ ( ".button-upgrade-browse" ) . on ( "click" , function ( ) {
@ -2387,24 +2387,24 @@ $(function() {
$ ( ".button-add-switch-schedule" ) . on ( "click" , function ( ) {
$ ( ".button-add-switch-schedule" ) . on ( "click" , function ( ) {
addSchedule ( { schType : 1 , schSwitch : - 1 } ) ;
addSchedule ( { schType : 1 , schSwitch : - 1 } ) ;
} ) ;
} ) ;
<!-- removeIf ( ! light ) -- >
//removeIf(!light)
$ ( ".button-add-light-schedule" ) . on ( "click" , function ( ) {
$ ( ".button-add-light-schedule" ) . on ( "click" , function ( ) {
addSchedule ( { schType : 2 , schSwitch : - 1 } ) ;
addSchedule ( { schType : 2 , schSwitch : - 1 } ) ;
} ) ;
} ) ;
<!-- endRemoveIf ( ! light ) -- >
//endRemoveIf(!light)
<!-- removeIf ( ! curtain ) -- >
//removeIf(!curtain)
$ ( ".button-add-curtain-schedule" ) . on ( "click" , function ( ) {
$ ( ".button-add-curtain-schedule" ) . on ( "click" , function ( ) {
addSchedule ( { schType : 3 , schSwitch : - 1 } ) ;
addSchedule ( { schType : 3 , schSwitch : - 1 } ) ;
} ) ;
} ) ;
<!-- endRemoveIf ( ! curtain ) -- >
//endRemoveIf(!curtain)
$ ( ".button-add-rpnrule" ) . on ( 'click' , addRPNRule ) ;
$ ( ".button-add-rpnrule" ) . on ( 'click' , addRPNRule ) ;
$ ( ".button-add-rpntopic" ) . on ( 'click' , addRPNTopic ) ;
$ ( ".button-add-rpntopic" ) . on ( 'click' , addRPNTopic ) ;
$ ( ".button-del-parent" ) . on ( 'click' , delParent ) ;
$ ( ".button-del-parent" ) . on ( 'click' , delParent ) ;
<!-- removeIf ( ! rfm69 ) -- >
//removeIf(!rfm69)
$ ( ".button-add-mapping" ) . on ( 'click' , addMapping ) ;
$ ( ".button-add-mapping" ) . on ( 'click' , addMapping ) ;
$ ( ".button-clear-counts" ) . on ( 'click' , doClearCounts ) ;
$ ( ".button-clear-counts" ) . on ( 'click' , doClearCounts ) ;
$ ( ".button-clear-messages" ) . on ( 'click' , doClearMessages ) ;
$ ( ".button-clear-messages" ) . on ( 'click' , doClearMessages ) ;
@ -2416,7 +2416,7 @@ $(function() {
for ( var i = 0 ; i < packets . columns ( ) [ 0 ] . length ; i ++ ) {
for ( var i = 0 ; i < packets . columns ( ) [ 0 ] . length ; i ++ ) {
filters [ i ] = false ;
filters [ i ] = false ;
}
}
<!-- endRemoveIf ( ! rfm69 ) -- >
//endRemoveIf(!rfm69)
$ ( ".gpio-select" ) . each ( function ( _ , elem ) {
$ ( ".gpio-select" ) . each ( function ( _ , elem ) {
initSelectGPIO ( elem )
initSelectGPIO ( elem )