mirror of
https://github.com/esphome/esphome.git
synced 2025-03-14 06:38:17 +00:00
Fix codeowners and naming convention
This commit is contained in:
parent
4eef228d79
commit
fb3d2c1e18
@ -30,6 +30,7 @@ esphome/components/airthings_wave_base/* @jeromelaban @kpfleming @ncareau
|
||||
esphome/components/airthings_wave_mini/* @ncareau
|
||||
esphome/components/airthings_wave_plus/* @jeromelaban
|
||||
esphome/components/airton/* @Procsiab
|
||||
esphome/components/airton/select/* @procsiab
|
||||
esphome/components/airton/switch/* @procsiab
|
||||
esphome/components/alarm_control_panel/* @grahambrown11 @hwstar
|
||||
esphome/components/alpha3/* @jan-hofmeier
|
||||
|
@ -35,19 +35,19 @@ void AirtonClimate::set_display_state(bool state, bool send_ir = false) {
|
||||
bool AirtonClimate::get_display_state() const { return this->settings_.display_state; }
|
||||
|
||||
void AirtonClimate::set_vertical_direction_state(VerticalDirection state) {
|
||||
if (state.toUint8() != this->settings_.vertical_direction_state.toUint8()) {
|
||||
if (state.to_uint8() != this->settings_.vertical_direction_state.to_uint8()) {
|
||||
this->settings_.vertical_direction_state = state;
|
||||
#ifdef USE_SELECT
|
||||
this->vertical_direction_select_->publish_state(state.toString());
|
||||
this->vertical_direction_select_->publish_state(state.to_string());
|
||||
#endif
|
||||
this->airton_rtc_.save(&this->settings_);
|
||||
}
|
||||
}
|
||||
void AirtonClimate::set_vertical_direction_state(const std::string state) {
|
||||
if (state != this->settings_.vertical_direction_state.toString()) {
|
||||
void AirtonClimate::set_vertical_direction_state(const std::string &state) {
|
||||
if (state != this->settings_.vertical_direction_state.to_string()) {
|
||||
VerticalDirection new_state;
|
||||
new_state.setDirection(state);
|
||||
this->settings_.vertical_direction_state = new_state.getDirection();
|
||||
new_state.set_direction(state);
|
||||
this->settings_.vertical_direction_state = new_state.get_direction();
|
||||
#ifdef USE_SELECT
|
||||
this->vertical_direction_select_->publish_state(state);
|
||||
#endif
|
||||
@ -81,7 +81,7 @@ void AirtonClimate::set_display_switch(switch_::Switch *sw) {
|
||||
void AirtonClimate::set_vertical_direction_select(select::Select *sel) {
|
||||
this->vertical_direction_select_ = sel;
|
||||
if (this->vertical_direction_select_ != nullptr) {
|
||||
this->vertical_direction_select_->publish_state(this->get_vertical_direction_state().toString());
|
||||
this->vertical_direction_select_->publish_state(this->get_vertical_direction_state().to_string());
|
||||
}
|
||||
}
|
||||
#endif // USE_SELECT
|
||||
@ -109,7 +109,7 @@ void AirtonClimate::transmit_state() {
|
||||
remote_state[3] |= this->temperature_();
|
||||
|
||||
remote_state[4] = 0;
|
||||
remote_state[4] |= this->get_vertical_direction_state().toUint8();
|
||||
remote_state[4] |= this->get_vertical_direction_state().to_uint8();
|
||||
|
||||
remote_state[5] = this->operation_settings_();
|
||||
|
||||
|
@ -23,10 +23,10 @@ class VerticalDirection {
|
||||
VERTICAL_DIRECTION_DOWN = 0x06,
|
||||
};
|
||||
|
||||
VerticalDirection(Direction direction = Direction::VERTICAL_DIRECTION_OFF) : _direction(direction) {}
|
||||
VerticalDirection(Direction direction = Direction::VERTICAL_DIRECTION_OFF) : direction_(direction) {}
|
||||
|
||||
std::string toString() const {
|
||||
switch (_direction) {
|
||||
std::string to_string() const {
|
||||
switch (direction_) {
|
||||
case Direction::VERTICAL_DIRECTION_SWING:
|
||||
return "swing";
|
||||
case Direction::VERTICAL_DIRECTION_UP:
|
||||
@ -45,31 +45,31 @@ class VerticalDirection {
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t toUint8() const { return static_cast<uint8_t>(_direction); }
|
||||
uint8_t to_uint8() const { return static_cast<uint8_t>(direction_); }
|
||||
|
||||
void setDirection(Direction direction) { _direction = direction; }
|
||||
void setDirection(std::string direction) {
|
||||
void set_direction(Direction direction) { direction_ = direction; }
|
||||
void set_direction(const std::string &direction) {
|
||||
if (direction == "swing") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_SWING;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_SWING;
|
||||
} else if (direction == "up") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_UP;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_UP;
|
||||
} else if (direction == "middle-up") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_MIDDLE_UP;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_MIDDLE_UP;
|
||||
} else if (direction == "middle") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_MIDDLE;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_MIDDLE;
|
||||
} else if (direction == "middle-down") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_MIDDLE_DOWN;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_MIDDLE_DOWN;
|
||||
} else if (direction == "down") {
|
||||
_direction = Direction::VERTICAL_DIRECTION_DOWN;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_DOWN;
|
||||
} else {
|
||||
_direction = Direction::VERTICAL_DIRECTION_OFF;
|
||||
direction_ = Direction::VERTICAL_DIRECTION_OFF;
|
||||
}
|
||||
}
|
||||
|
||||
Direction getDirection() const { return _direction; }
|
||||
Direction get_direction() const { return direction_; }
|
||||
|
||||
private:
|
||||
Direction _direction;
|
||||
Direction direction_;
|
||||
};
|
||||
|
||||
} // namespace airton
|
||||
|
@ -4,7 +4,7 @@ namespace esphome {
|
||||
namespace airton {
|
||||
|
||||
void VerticalDirectionSelect::control(const std::string &value) {
|
||||
if (this->parent_->get_vertical_direction_state().toString() != value) {
|
||||
if (this->parent_->get_vertical_direction_state().to_string() != value) {
|
||||
ESP_LOGD("vertical_direction", "Select received value: %s", value.c_str());
|
||||
this->parent_->set_vertical_direction_state(value);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user