mirror of
https://github.com/esphome/esphome.git
synced 2026-01-17 15:34:50 -07:00
Compare commits
10 Commits
toshiba_st
...
cse7766_st
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f41ebf831d | ||
|
|
91e5191c67 | ||
|
|
325a812202 | ||
|
|
d49c06df35 | ||
|
|
0b676c0daa | ||
|
|
d4bbad9ea2 | ||
|
|
4befd86a96 | ||
|
|
e13743a9c3 | ||
|
|
d3d96afbba | ||
|
|
6e77182523 |
@@ -207,20 +207,24 @@ void CSE7766Component::parse_data_() {
|
||||
|
||||
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
|
||||
{
|
||||
std::string buf = "Parsed:";
|
||||
// Buffer: 7 + 15 + 33 + 15 + 25 = 95 chars max + null, rounded to 128 for safety margin.
|
||||
// Float sizes with %.4f can be up to 11 chars for large values (e.g., 999999.9999).
|
||||
char buf[128];
|
||||
size_t pos = buf_append_printf(buf, sizeof(buf), 0, "Parsed:");
|
||||
if (have_voltage) {
|
||||
buf += str_sprintf(" V=%fV", voltage);
|
||||
pos = buf_append_printf(buf, sizeof(buf), pos, " V=%.4fV", voltage);
|
||||
}
|
||||
if (have_current) {
|
||||
buf += str_sprintf(" I=%fmA (~%fmA)", current * 1000.0f, calculated_current * 1000.0f);
|
||||
pos = buf_append_printf(buf, sizeof(buf), pos, " I=%.4fmA (~%.4fmA)", current * 1000.0f,
|
||||
calculated_current * 1000.0f);
|
||||
}
|
||||
if (have_power) {
|
||||
buf += str_sprintf(" P=%fW", power);
|
||||
pos = buf_append_printf(buf, sizeof(buf), pos, " P=%.4fW", power);
|
||||
}
|
||||
if (energy != 0.0f) {
|
||||
buf += str_sprintf(" E=%fkWh (%u)", energy, cf_pulses);
|
||||
buf_append_printf(buf, sizeof(buf), pos, " E=%.4fkWh (%u)", energy, cf_pulses);
|
||||
}
|
||||
ESP_LOGVV(TAG, "%s", buf.c_str());
|
||||
ESP_LOGVV(TAG, "%s", buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "toshiba.h"
|
||||
#include "esphome/components/remote_base/toshiba_ac_protocol.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -428,17 +427,10 @@ void ToshibaClimate::setup() {
|
||||
// Never send nan to HA
|
||||
if (std::isnan(this->target_temperature))
|
||||
this->target_temperature = 24;
|
||||
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
|
||||
// Log final state for debugging HA errors
|
||||
const char *fan_mode_str = "NONE";
|
||||
char fan_mode_buf[4]; // max 3 digits for fan mode enum + null
|
||||
if (this->fan_mode.has_value()) {
|
||||
buf_append_printf(fan_mode_buf, sizeof(fan_mode_buf), 0, "%d", static_cast<int>(this->fan_mode.value()));
|
||||
fan_mode_str = fan_mode_buf;
|
||||
}
|
||||
ESP_LOGV(TAG, "Setup complete - Mode: %d, Fan: %s, Swing: %d, Temp: %.1f", static_cast<int>(this->mode), fan_mode_str,
|
||||
ESP_LOGV(TAG, "Setup complete - Mode: %d, Fan: %s, Swing: %d, Temp: %.1f", static_cast<int>(this->mode),
|
||||
this->fan_mode.has_value() ? std::to_string(static_cast<int>(this->fan_mode.value())).c_str() : "NONE",
|
||||
static_cast<int>(this->swing_mode), this->target_temperature);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ToshibaClimate::transmit_state() {
|
||||
|
||||
Reference in New Issue
Block a user