Skip to content

Commit ea4b33e

Browse files
committed
fix(mqtt): publish to custom state topic if enabled
1 parent 5b5b9cf commit ea4b33e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

main/MqttManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,9 @@ void MqttManager::publishLockState(const int currentState, const int targetState
459459
stateStr = std::to_string(currentState);
460460
}
461461
publish(m_mqttConfig.lockStateTopic, stateStr, 0, true);
462+
if(m_mqttConfig.lockEnableCustomState){
463+
publish(m_mqttConfig.lockCustomStateTopic, (targetState == LockManager::UNLOCKED) ? std::to_string(m_mqttConfig.customLockActions.at("UNLOCK")) : std::to_string(m_mqttConfig.customLockActions.at("LOCK")));
464+
}
462465
}
463466

464467
/**

0 commit comments

Comments
 (0)