Always use brackets around single log macros (#4072)

This commit is contained in:
Jesse Hills
2022-11-23 10:32:51 +13:00
committed by GitHub
parent 91925b1826
commit ef26677b67
29 changed files with 133 additions and 68 deletions
@@ -138,18 +138,23 @@ climate::ClimateTraits TuyaClimate::traits() {
void TuyaClimate::dump_config() {
LOG_CLIMATE("", "Tuya Climate", this);
if (this->switch_id_.has_value())
if (this->switch_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Switch has datapoint ID %u", *this->switch_id_);
if (this->active_state_id_.has_value())
}
if (this->active_state_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Active state has datapoint ID %u", *this->active_state_id_);
if (this->target_temperature_id_.has_value())
}
if (this->target_temperature_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Target Temperature has datapoint ID %u", *this->target_temperature_id_);
if (this->current_temperature_id_.has_value())
}
if (this->current_temperature_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Current Temperature has datapoint ID %u", *this->current_temperature_id_);
}
LOG_PIN(" Heating State Pin: ", this->heating_state_pin_);
LOG_PIN(" Cooling State Pin: ", this->cooling_state_pin_);
if (this->eco_id_.has_value())
if (this->eco_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Eco has datapoint ID %u", *this->eco_id_);
}
}
void TuyaClimate::compute_preset_() {
+8 -4
View File
@@ -112,14 +112,18 @@ void TuyaCover::dump_config() {
ESP_LOGCONFIG(TAG, " Configured as Inverted, but direction_datapoint isn't configured");
}
}
if (this->control_id_.has_value())
if (this->control_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Control has datapoint ID %u", *this->control_id_);
if (this->direction_id_.has_value())
}
if (this->direction_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Direction has datapoint ID %u", *this->direction_id_);
if (this->position_id_.has_value())
}
if (this->position_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Position has datapoint ID %u", *this->position_id_);
if (this->position_report_id_.has_value())
}
if (this->position_report_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Position Report has datapoint ID %u", *this->position_report_id_);
}
}
cover::CoverTraits TuyaCover::get_traits() {
+8 -4
View File
@@ -49,14 +49,18 @@ void TuyaFan::setup() {
void TuyaFan::dump_config() {
LOG_FAN("", "Tuya Fan", this);
if (this->speed_id_.has_value())
if (this->speed_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Speed has datapoint ID %u", *this->speed_id_);
if (this->switch_id_.has_value())
}
if (this->switch_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Switch has datapoint ID %u", *this->switch_id_);
if (this->oscillation_id_.has_value())
}
if (this->oscillation_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Oscillation has datapoint ID %u", *this->oscillation_id_);
if (this->direction_id_.has_value())
}
if (this->direction_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Direction has datapoint ID %u", *this->direction_id_);
}
}
fan::FanTraits TuyaFan::get_traits() {
+4 -2
View File
@@ -92,10 +92,12 @@ void TuyaLight::setup() {
void TuyaLight::dump_config() {
ESP_LOGCONFIG(TAG, "Tuya Dimmer:");
if (this->dimmer_id_.has_value())
if (this->dimmer_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Dimmer has datapoint ID %u", *this->dimmer_id_);
if (this->switch_id_.has_value())
}
if (this->switch_id_.has_value()) {
ESP_LOGCONFIG(TAG, " Switch has datapoint ID %u", *this->switch_id_);
}
if (this->rgb_id_.has_value()) {
ESP_LOGCONFIG(TAG, " RGB has datapoint ID %u", *this->rgb_id_);
} else if (this->hsv_id_.has_value()) {