Explorar o código

fix state not getting handled when MQTT isnt enabled

Christopher Mullins %!s(int64=8) %!d(string=hai) anos
pai
achega
63e4acacca
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      src/main.cpp

+ 4 - 4
src/main.cpp

@@ -94,11 +94,11 @@ void onPacketSentHandler(uint8_t* packet, const MiLightRemoteConfig& config) {
   const MiLightRemoteConfig& remoteConfig =
     *MiLightRemoteConfig::fromType(bulbId.deviceType);
 
-  if (mqttClient) {
-    GroupState& groupState = stateStore->get(bulbId);
-    groupState.patch(result);
-    stateStore->set(bulbId, groupState);
+  GroupState& groupState = stateStore->get(bulbId);
+  groupState.patch(result);
+  stateStore->set(bulbId, groupState);
 
+  if (mqttClient) {
     // Sends the state delta derived from the raw packet
     char output[200];
     result.printTo(output);