1
0
mirror of https://github.com/esphome/esphome.git synced 2024-10-06 02:40:56 +01:00

ci format

This commit is contained in:
MagicBear 2024-09-14 00:06:58 +09:00
parent f558aa8a3a
commit 74ad426391

View File

@ -105,13 +105,16 @@ void DaikinArcClimate::transmit_state() {
remote_state[8] = fan_speed >> 8;
remote_state[9] = fan_speed & 0xff;
if (transmit_flag_ == 5)
{
if (transmit_flag_ == 5) {
remote_header[9] = 0x06;
// remote_header[9] = 0x16; 水平
remote_header[12] = (this->swing_mode == climate::CLIMATE_SWING_BOTH || this->swing_mode == climate::CLIMATE_SWING_VERTICAL) ? 0xf1 : 0xe1;
remote_header[13] = (this->swing_mode == climate::CLIMATE_SWING_BOTH || this->swing_mode == climate::CLIMATE_SWING_HORIZONTAL) ? 0x1e : 0x01;
remote_header[12] =
(this->swing_mode == climate::CLIMATE_SWING_BOTH || this->swing_mode == climate::CLIMATE_SWING_VERTICAL) ? 0xf1
: 0xe1;
remote_header[13] =
(this->swing_mode == climate::CLIMATE_SWING_BOTH || this->swing_mode == climate::CLIMATE_SWING_HORIZONTAL)
? 0x1e
: 0x01;
}
// Calculate checksum
@ -257,8 +260,8 @@ climate::ClimateTraits DaikinArcClimate::traits() {
traits.set_supports_current_temperature(true);
traits.set_supports_current_humidity(false);
traits.set_supports_target_humidity(true);
std::set<climate::ClimateSwingMode> supported_swing_modes = {
climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_BOTH, climate::CLIMATE_SWING_VERTICAL,
std::set<climate::ClimateSwingMode> supported_swing_modes = {climate::CLIMATE_SWING_OFF, climate::CLIMATE_SWING_BOTH,
climate::CLIMATE_SWING_VERTICAL,
climate::CLIMATE_SWING_HORIZONTAL};
traits.set_supported_swing_modes(std::move(supported_swing_modes));
traits.set_visual_min_humidity(38);
@ -494,16 +497,12 @@ bool DaikinArcClimate::on_receive(remote_base::RemoteReceiveData data) {
}
}
}
if (is_extend_state_frame)
{
if ((state_frame[12] == 0xf1 || state_frame[12] == 0xc1) && (state_frame[13] == 0x1e || state_frame[13] == 0x1f))
{
if (is_extend_state_frame) {
if ((state_frame[12] == 0xf1 || state_frame[12] == 0xc1) && (state_frame[13] == 0x1e || state_frame[13] == 0x1f)) {
this->swing_mode = climate::CLIMATE_SWING_BOTH;
} else if (state_frame[12] == 0xf1 || state_frame[12] == 0xc1)
{
} else if (state_frame[12] == 0xf1 || state_frame[12] == 0xc1) {
this->swing_mode = climate::CLIMATE_SWING_VERTICAL;
} else if (state_frame[13] == 0x1e || state_frame[13] == 0x1f)
{
} else if (state_frame[13] == 0x1e || state_frame[13] == 0x1f) {
this->swing_mode = climate::CLIMATE_SWING_HORIZONTAL;
}
this->publish_state();
@ -514,8 +513,7 @@ bool DaikinArcClimate::on_receive(remote_base::RemoteReceiveData data) {
void DaikinArcClimate::control(const climate::ClimateCall &call) {
transmit_flag_ = 0;
if (call.get_mode().has_value())
{
if (call.get_mode().has_value()) {
transmit_flag_ = 1;
}
if (call.get_target_temperature().has_value())