ESPHome 2026.9.0-dev
Loading...
Searching...
No Matches
mitsubishi_cn105_component.cpp
Go to the documentation of this file.
2
3#include "esphome/core/log.h"
4
5#include <cinttypes>
6
8
9static const char *const TAG = "mitsubishi_cn105";
10
12 ESP_LOGCONFIG(TAG, "Mitsubishi CN105:");
14 ESP_LOGCONFIG(TAG, " Telemetry polling min interval: %" PRIu32 " ms",
16 } else {
17 ESP_LOGCONFIG(TAG, " Telemetry polling: DISABLED");
18 }
19 ESP_LOGCONFIG(TAG,
20 " Update interval: %" PRIu32 " ms\n"
21 " UART: baud_rate=%" PRIu32 " data_bits=%u parity=%s stop_bits=%u",
22 this->hp_.get_update_interval(), this->parent_->get_baud_rate(), this->parent_->get_data_bits(),
23 LOG_STR_ARG(parity_to_str(this->parent_->get_parity())), this->parent_->get_stop_bits());
24}
25
27
29 if (this->hp_.update()) {
30 // Encoding A only supports whole °C values and cannot represent native °F setpoints accurately.
31 // See https://github.com/esphome/esphome/pull/15488#issuecomment-5268304343
32 if (this->temperature_mapping_.get_use_fahrenheit() && !this->hp_.is_temperature_encoding_b()) {
33 ESP_LOGE(TAG, "Unit reports encoding A, which cannot accurately convert °F setpoints; disable 'use_fahrenheit'");
34 this->mark_failed();
35 return;
36 }
38 }
39}
40
42 if (const auto &direction = this->vertical.get_direction(); direction.has_value()) {
44 }
45 this->parent_->publish_status();
46}
47
48} // namespace esphome::mitsubishi_cn105
void mark_failed()
Mark this component as failed.
void set_vane_mode(MitsubishiCN105::VaneMode vane_mode)
UARTParityOptions get_parity() const
UARTComponent * parent_
Definition uart.h:73
FanDirection direction
Definition fan.h:5
const std::optional< VerticalVaneMode > & get_direction() const