From d268c14f7ef69bcee455a60fecea4d2af9f105e7 Mon Sep 17 00:00:00 2001 From: Kevin Ahrendt Date: Mon, 14 Jul 2025 20:20:46 -0400 Subject: [PATCH] Apply suggestions from code review Fixes unsigned integer wrong type Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- esphome/components/mqtt/mqtt_date.cpp | 2 +- esphome/components/mqtt/mqtt_datetime.cpp | 6 +++--- esphome/components/mqtt/mqtt_time.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/esphome/components/mqtt/mqtt_date.cpp b/esphome/components/mqtt/mqtt_date.cpp index 5f6923fc3e..0f0a334ae7 100644 --- a/esphome/components/mqtt/mqtt_date.cpp +++ b/esphome/components/mqtt/mqtt_date.cpp @@ -26,7 +26,7 @@ void MQTTDateComponent::setup() { if (root["month"].is()) { call.set_month(root["month"]); } - if (root["day"].is()) { + if (root["day"].is()) { call.set_day(root["day"]); } call.perform(); diff --git a/esphome/components/mqtt/mqtt_datetime.cpp b/esphome/components/mqtt/mqtt_datetime.cpp index c74cb159c8..5c56baabe0 100644 --- a/esphome/components/mqtt/mqtt_datetime.cpp +++ b/esphome/components/mqtt/mqtt_datetime.cpp @@ -29,13 +29,13 @@ void MQTTDateTimeComponent::setup() { if (root["day"].is()) { call.set_day(root["day"]); } - if (root["hour"].is()) { + if (root["hour"].is()) { call.set_hour(root["hour"]); } - if (root["minute"].is()) { + if (root["minute"].is()) { call.set_minute(root["minute"]); } - if (root["second"].is()) { + if (root["second"].is()) { call.set_second(root["second"]); } call.perform(); diff --git a/esphome/components/mqtt/mqtt_time.cpp b/esphome/components/mqtt/mqtt_time.cpp index a19c16bb21..0c95bd8147 100644 --- a/esphome/components/mqtt/mqtt_time.cpp +++ b/esphome/components/mqtt/mqtt_time.cpp @@ -20,13 +20,13 @@ MQTTTimeComponent::MQTTTimeComponent(TimeEntity *time) : time_(time) {} void MQTTTimeComponent::setup() { this->subscribe_json(this->get_command_topic_(), [this](const std::string &topic, JsonObject root) { auto call = this->time_->make_call(); - if (root["hour"].is()) { + if (root["hour"].is()) { call.set_hour(root["hour"]); } - if (root["minute"].is()) { + if (root["minute"].is()) { call.set_minute(root["minute"]); } - if (root["second"].is()) { + if (root["second"].is()) { call.set_second(root["second"]); } call.perform();