[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
+13
-11
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
|
## 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}'`
|
`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
|
# ifndef ANEOPIX_BRIGHTNESS
|
||||||
# define ANEOPIX_BRIGHTNESS 20 // Set Default maximum RGB brightness to approx 10% (0-255 scale)
|
# define ANEOPIX_BRIGHTNESS 20 // Set Default maximum RGB brightness to approx 10% (0-255 scale)
|
||||||
# endif
|
# endif
|
||||||
# ifndef DEAULT_ADJ_BRIGHTNESS
|
# ifndef DEFAULT_ADJ_BRIGHTNESS
|
||||||
# define DEAULT_ADJ_BRIGHTNESS 255 // Set Default RGB adjustable brightness
|
# define DEFAULT_ADJ_BRIGHTNESS 255 // Set Default RGB adjustable brightness
|
||||||
# endif
|
# endif
|
||||||
# ifndef ANEOPIX_COLOR_SCHEME // allow for different color combinations
|
# ifndef ANEOPIX_COLOR_SCHEME // allow for different color combinations
|
||||||
# define ANEOPIX_COLOR_SCHEME 0
|
# define ANEOPIX_COLOR_SCHEME 0
|
||||||
|
|||||||
@@ -289,6 +289,8 @@ void ActuatorTrigger() {
|
|||||||
StaticJsonDocument<64> jsonBuffer;
|
StaticJsonDocument<64> jsonBuffer;
|
||||||
JsonObject ONOFFdata = jsonBuffer.to<JsonObject>();
|
JsonObject ONOFFdata = jsonBuffer.to<JsonObject>();
|
||||||
ONOFFdata["cmd"] = (int)level;
|
ONOFFdata["cmd"] = (int)level;
|
||||||
|
ONOFFdata["origin"] = subjectGTWONOFFtoMQTT;
|
||||||
|
handleJsonEnqueue(ONOFFdata, QueueSemaphoreTimeOutTask);
|
||||||
# ifdef ESP32
|
# ifdef ESP32
|
||||||
if (ONOFFConfig.useLastStateOnStart) {
|
if (ONOFFConfig.useLastStateOnStart) {
|
||||||
ONOFFdata["save"] = true;
|
ONOFFdata["save"] = true;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
# include "ZgatewayBLEConnect.h"
|
# include "ZgatewayBLEConnect.h"
|
||||||
# define convertTemp_CtoF(c) ((c * 1.8) + 32)
|
# define convertTemp_CtoF(c) ((c * 1.8) + 32)
|
||||||
|
|
||||||
extern bool BTProcessLock;
|
|
||||||
extern std::vector<BLEdevice*> devices;
|
extern std::vector<BLEdevice*> devices;
|
||||||
|
|
||||||
NimBLERemoteCharacteristic* zBLEConnect::getCharacteristic(const NimBLEUUID& service,
|
NimBLERemoteCharacteristic* zBLEConnect::getCharacteristic(const NimBLEUUID& service,
|
||||||
|
|||||||
+8
-7
@@ -801,26 +801,25 @@ void delayWithOTA(long waitMillis) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZmqttDiscovery
|
|
||||||
void SYSConfig_init() {
|
void SYSConfig_init() {
|
||||||
|
#ifdef ZmqttDiscovery
|
||||||
SYSConfig.discovery = true;
|
SYSConfig.discovery = true;
|
||||||
SYSConfig.ohdiscovery = OpenHABDiscovery;
|
SYSConfig.ohdiscovery = OpenHABDiscovery;
|
||||||
|
#endif
|
||||||
#ifdef RGB_INDICATORS
|
#ifdef RGB_INDICATORS
|
||||||
SYSConfig.rgbbrightness = DEAULT_ADJ_BRIGHTNESS;
|
SYSConfig.rgbbrightness = DEFAULT_ADJ_BRIGHTNESS;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void SYSConfig_fromJson(JsonObject& SYSdata) {
|
void SYSConfig_fromJson(JsonObject& SYSdata) {
|
||||||
|
#ifdef ZmqttDiscovery
|
||||||
Config_update(SYSdata, "disc", SYSConfig.discovery);
|
Config_update(SYSdata, "disc", SYSConfig.discovery);
|
||||||
Config_update(SYSdata, "ohdisc", SYSConfig.ohdiscovery);
|
Config_update(SYSdata, "ohdisc", SYSConfig.ohdiscovery);
|
||||||
|
#endif
|
||||||
#ifdef RGB_INDICATORS
|
#ifdef RGB_INDICATORS
|
||||||
Config_update(SYSdata, "rgbb", SYSConfig.rgbbrightness);
|
Config_update(SYSdata, "rgbb", SYSConfig.rgbbrightness);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
void SYSConfig_init() {}
|
|
||||||
void SYSConfig_fromJson(JsonObject& SYSdata) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
void SYSConfig_load() {
|
void SYSConfig_load() {
|
||||||
@@ -2699,7 +2698,9 @@ bool checkForUpdates() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# else
|
# else
|
||||||
bool checkForUpdates() {}
|
bool checkForUpdates() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
# elif ESP8266
|
# elif ESP8266
|
||||||
# include <ESP8266httpUpdate.h>
|
# include <ESP8266httpUpdate.h>
|
||||||
|
|||||||
Reference in new issue
Block a user