Skip to content

Commit

Permalink
Hide brightness control for 4 wire models
Browse files Browse the repository at this point in the history
And some tidying up files
  • Loading branch information
visualapproach committed Jul 8, 2024
1 parent 2629d7a commit 9ddaad6
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 6 deletions.
18 changes: 15 additions & 3 deletions Code/data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ <h2>Control</h2>
<td><input type="range" id="amb" min="-40" max="60" step="1" value="20" onmouseup="sendCommand('setAmbient')" ontouchend="sendCommand('setAmbient')"></td>
<td style="text-align:right" id="sliderAmbVal">n/a</td>
</tr>
<tr>
<tr id="rowBrightness">
<td>Brightness <span data-text="Remember: When set to '0' the display and all buttons on the pump are completely dimmed out (off), but will light up for 5s when pressing a button." class="tooltip">?</span></td>
<td><input type="range" id="brt" min="0" max="8" step="1" value="7" onmouseup="sendCommand('setBrightness')" ontouchend="sendCommand('setBrightness')"></td>
<td style="text-align:right" id="sliderBrtVal">n/a</td>
Expand All @@ -95,7 +95,7 @@ <h2>Control</h2>
<tr>
<td class="center">Temperature</td>
<td class="center">Ambient Temperature</td>
<td class="center">Brightness <span data-text="Remember: When set to '0' the display and all buttons on the pump are completely dimmed out (off), but will light up for 5s when pressing a button." class="tooltip left">?</span></td>
<td id="brightnessHeader" class="center">Brightness <span data-text="Remember: When set to '0' the display and all buttons on the pump are completely dimmed out (off), but will light up for 5s when pressing a button." class="tooltip left">?</span></td>
</tr>
<tr>
<td class="center">
Expand All @@ -119,7 +119,7 @@ <h2>Control</h2>
</div>
</td>
<td class="center">
<div class="selector">
<div class="selector" id="divBrightness">
<button onclick="increaseNumber('selectorBrt');sendCommand('setBrightnessSelector')" class="selectorbutton selectortop"></button>
<input type="number" id="selectorBrt" min="0" max="8" step="1" value="7" type="text" class="selectorvalue" onchange="sendCommand('setBrightnessSelector')">
<button onclick="decreaseNumber('selectorBrt');sendCommand('setBrightnessSelector')" class="selectorbutton selectorbottom"></button>
Expand Down Expand Up @@ -482,6 +482,18 @@ <h2>Totals</h2>
// godmode available
document.getElementById("god").style.display = msgobj.HASGOD ? "table-cell" : "none";
document.getElementById("godswitch").style.display = msgobj.HASGOD ? "table-cell" : "none";
if(msgobj.MODEL.startsWith("NO")){
document.getElementById("divBrightness").style.display = "none"
document.getElementById("brightnessHeader").style.display = "none"
document.getElementById("rowBrightness").style.display = "none"
}
else
{
document.getElementById("divBrightness").style.display = "table-cell"
document.getElementById("brightnessHeader").style.display = "table-cell"
document.getElementById("rowBrightness").style.display = "table-cell"
}

}

if (msgobj.CONTENT == "STATES") {
Expand Down
4 changes: 4 additions & 0 deletions Code/src/ha.txt → Code/lib/smarthomes/ha.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#include <Arduino.h>
#include "ArduinoJson.h"
#include "config.h"
#include "main.h"
/*
Note, following does not work!
doc[F("key")] = F("Value")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
#include <Arduino.h>
#include "ArduinoJson.h"
#include "config.h"
#include "main.h"

/**
* prometheus related functions and char buffers
* @author svanscho
Expand Down
6 changes: 5 additions & 1 deletion Code/src/config.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef CONFIG_H
#define CONFIG_H
#include <Arduino.h>
#ifdef ESP8266
#include <ESP8266WiFi.h>
Expand Down Expand Up @@ -161,4 +163,6 @@ struct sMQTT_info
bool useMqtt = false;
};

sMQTT_info* mqtt_info;
sMQTT_info* mqtt_info;

#endif
4 changes: 2 additions & 2 deletions Code/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2125,5 +2125,5 @@ void setTemperatureFromSensor()
}
}

#include "ha.txt"
#include "prometheus.txt"
#include "ha.hpp"
#include "prometheus.hpp"

0 comments on commit 9ddaad6

Please sign in to comment.