Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYS] Fix default adjustable setting when not using discovery and boolean return #1825

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/use/gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`

Expand Down
4 changes: 2 additions & 2 deletions main/User_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions main/ZactuatorONOFF.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion main/ZgatewayBLEConnect.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
23 changes: 12 additions & 11 deletions main/main.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
#endif
#ifdef RGB_INDICATORS
Config_update(SYSdata, "rgbb", SYSConfig.rgbbrightness);
# endif
}
#else
void SYSConfig_init() {}
void SYSConfig_fromJson(JsonObject& SYSdata) {}
#endif
}

#if defined(ESP32)
void SYSConfig_load() {
Expand Down Expand Up @@ -2699,7 +2698,9 @@ bool checkForUpdates() {
}

# else
bool checkForUpdates() {}
bool checkForUpdates() {
return false;
}
# endif
# elif ESP8266
# include <ESP8266httpUpdate.h>
Expand Down