Explorar el Código

fix state not getting handled when MQTT isnt enabled

Christopher Mullins hace 8 años
padre
commit
63e4acacca
Se han modificado 1 ficheros con 4 adiciones y 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);