Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Jan 8, 2025
1 parent 2d7a334 commit 6a1dbb4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cmnds/cmd_newLEDDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,9 @@ void apply_smart_light() {

// I am not sure if it's the best place to do it
// NOTE: this will broadcast MQTT only if a flag is set
#if ENABLE_MQTT
sendFullRGBCW_IfEnabled();
#endif
}

void led_gamma_list (void) { // list RGB gamma settings
Expand Down Expand Up @@ -1352,7 +1354,9 @@ commandResult_t LED_SetBaseColor(const void *context, const char *cmd, const cha
if (CFG_HasFlag(OBK_FLAG_LED_SETTING_WHITE_RGB_ENABLES_CW)) {
if (!stricmp(c, "FFFFFF")) {
SET_LightMode(Light_Temperature);
#if ENABLE_MQTT
sendTemperatureChange();
#endif
apply_smart_light();
return CMD_RES_OK;
}
Expand Down
2 changes: 2 additions & 0 deletions src/driver/drv_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ static void Batt_Measure() {
if (g_battlevel > 100)
g_battlevel = 100;

#if ENABLE_MQTT
MQTT_PublishMain_StringInt("voltage", (int)g_battvoltage, 0);
MQTT_PublishMain_StringInt("battery", (int)g_battlevel, 0);
#endif
g_lastbattlevel = (int)g_battlevel;
g_lastbattvoltage = (int)g_battvoltage;
ADDLOG_INFO(LOG_FEATURE_DRV, "DRV_BATTERY : battery voltage : %f and percentage %f%%", g_battvoltage, g_battlevel);
Expand Down
2 changes: 2 additions & 0 deletions src/driver/drv_doorSensorWithDeepSleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ void DoorDeepSleep_OnEverySecond() {
} else if (Main_HasMQTTConnected() && Main_HasWiFiConnected()) { // executes every second when connection is established

DoorDeepSleep_QueueNewEvents();
#if ENABLE_MQTT
PublishQueuedItems(); // publish those items that were queued when device was offline
#endif

g_noChangeTimePassed++;
if (g_noChangeTimePassed >= setting_timeRequiredUntilDeepSleep) {
Expand Down

0 comments on commit 6a1dbb4

Please sign in to comment.