[SYS] Fix default adjustable setting when not using discovery and boolean init (#1825)
This commit is contained in:
1 parent
5a07020144
commit
8b204f2911
5 files changed
+18
-16
No files matched your search
+1
-1
@@ -203,7 +203,7 @@ The pre-built binaries for **rfbridge** and **avatto-bakeey-ir** have the above
|
||||
|
||||
## Change the LED indicator brightness
|
||||
|
||||
Minimum: 0, Maximum: 255, Default defined by DEAULT_ADJ_BRIGHTNESS
|
||||
Minimum: 0, Maximum: 255, Default defined by DEFAULT_ADJ_BRIGHTNESS
|
||||
|
||||
`mosquitto_pub -t "home/OpenMQTTGateway/commands/MQTTtoSYS/config" -m '{"brightness":200}'`
|
||||
|
||||
|
||||
+2
-2
@@ -521,8 +521,8 @@ Adafruit_NeoPixel leds2(ANEOPIX_IND_NUM_LEDS, ANEOPIX_IND_DATA_GPIO2, ANEOPIX_IN
|
||||
# ifndef ANEOPIX_BRIGHTNESS
|
||||
# define ANEOPIX_BRIGHTNESS 20 // Set Default maximum RGB brightness to approx 10% (0-255 scale)
|
||||
# endif
|
||||
# ifndef DEAULT_ADJ_BRIGHTNESS
|
||||
# define DEAULT_ADJ_BRIGHTNESS 255 // Set Default RGB adjustable brightness
|
||||
# ifndef DEFAULT_ADJ_BRIGHTNESS
|
||||
# define DEFAULT_ADJ_BRIGHTNESS 255 // Set Default RGB adjustable brightness
|
||||
# endif
|
||||
# ifndef ANEOPIX_COLOR_SCHEME // allow for different color combinations
|
||||
# define ANEOPIX_COLOR_SCHEME 0
|
||||
|
||||
@@ -289,6 +289,8 @@ void ActuatorTrigger() {
|
||||
StaticJsonDocument<64> jsonBuffer;
|
||||
JsonObject ONOFFdata = jsonBuffer.to<JsonObject>();
|
||||
ONOFFdata["cmd"] = (int)level;
|
||||
ONOFFdata["origin"] = subjectGTWONOFFtoMQTT;
|
||||
handleJsonEnqueue(ONOFFdata, QueueSemaphoreTimeOutTask);
|
||||
# ifdef ESP32
|
||||
if (ONOFFConfig.useLastStateOnStart) {
|
||||
ONOFFdata["save"] = true;
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
# include "ZgatewayBLEConnect.h"
|
||||
# define convertTemp_CtoF(c) ((c * 1.8) + 32)
|
||||
|
||||
extern bool BTProcessLock;
|
||||
extern std::vector<BLEdevice*> devices;
|
||||
|
||||
NimBLERemoteCharacteristic* zBLEConnect::getCharacteristic(const NimBLEUUID& service,
|
||||
|
||||
+13
-12
@@ -801,26 +801,25 @@ void delayWithOTA(long waitMillis) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ZmqttDiscovery
|
||||
void SYSConfig_init() {
|
||||
#ifdef ZmqttDiscovery
|
||||
SYSConfig.discovery = true;
|
||||
SYSConfig.ohdiscovery = OpenHABDiscovery;
|
||||
# ifdef RGB_INDICATORS
|
||||
SYSConfig.rgbbrightness = DEAULT_ADJ_BRIGHTNESS;
|
||||
# endif
|
||||
#endif
|
||||
#ifdef RGB_INDICATORS
|
||||
SYSConfig.rgbbrightness = DEFAULT_ADJ_BRIGHTNESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void SYSConfig_fromJson(JsonObject& SYSdata) {
|
||||
#ifdef ZmqttDiscovery
|
||||
Config_update(SYSdata, "disc", SYSConfig.discovery);
|
||||
Config_update(SYSdata, "ohdisc", SYSConfig.ohdiscovery);
|
||||
# ifdef RGB_INDICATORS
|
||||
Config_update(SYSdata, "rgbb", SYSConfig.rgbbrightness);
|
||||
# endif
|
||||
}
|
||||
#else
|
||||
void SYSConfig_init() {}
|
||||
void SYSConfig_fromJson(JsonObject& SYSdata) {}
|
||||
#endif
|
||||
#ifdef RGB_INDICATORS
|
||||
Config_update(SYSdata, "rgbb", SYSConfig.rgbbrightness);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(ESP32)
|
||||
void SYSConfig_load() {
|
||||
@@ -2699,7 +2698,9 @@ bool checkForUpdates() {
|
||||
}
|
||||
|
||||
# else
|
||||
bool checkForUpdates() {}
|
||||
bool checkForUpdates() {
|
||||
return false;
|
||||
}
|
||||
# endif
|
||||
# elif ESP8266
|
||||
# include <ESP8266httpUpdate.h>
|
||||
|
||||
Reference in new issue
Block a user