1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 00:05:43 +00:00

[mqtt] clang-tidy fixes for #7822 (#7877)

This commit is contained in:
Keith Burzinski
2024-11-27 16:19:41 -06:00
committed by GitHub
parent 8439232b11
commit f2e8e655ba
2 changed files with 15 additions and 8 deletions

View File

@@ -80,8 +80,7 @@ const EntityBase *MQTTAlarmControlPanelComponent::get_entity() const { return th
bool MQTTAlarmControlPanelComponent::send_initial_state() { return this->publish_state(); }
bool MQTTAlarmControlPanelComponent::publish_state() {
bool success = true;
const char *state_s = "";
const char *state_s;
switch (this->alarm_control_panel_->get_state()) {
case ACP_STATE_DISARMED:
state_s = "disarmed";
@@ -116,9 +115,7 @@ bool MQTTAlarmControlPanelComponent::publish_state() {
default:
state_s = "unknown";
}
if (!this->publish(this->get_state_topic_(), state_s))
success = false;
return success;
return this->publish(this->get_state_topic_(), state_s);
}
} // namespace mqtt