소스 검색

fix state not getting handled when MQTT isnt enabled

Christopher Mullins 8 년 전
부모
커밋
63e4acacca
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  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);