mirror of
https://github.com/ElVit/esphome_components.git
synced 2026-10-18 13:07:28 +02:00
renamed getResponseByte to get_response_byte and getExtraResponseByte to get_extra_response_byte
This commit is contained in:
@@ -664,7 +664,7 @@ sensor:
|
||||
unit_of_measurement: °C
|
||||
lambda: |-
|
||||
// get the requried byte
|
||||
int byte = my_heatpump->getResponseByte(46);
|
||||
int byte = my_heatpump->get_response_byte(46);
|
||||
// a valid byte range is 0x00-0xFF
|
||||
// do not update if the byte is invalid
|
||||
if (byte < 0) return {};
|
||||
@@ -678,7 +678,7 @@ text_sensor:
|
||||
update_interval: 3s
|
||||
lambda: |-
|
||||
// get the requried byte
|
||||
int byte = my_heatpump->getResponseByte(9);
|
||||
int byte = my_heatpump->get_response_byte(9);
|
||||
// a valid byte range is 0x00-0xFF
|
||||
// do not update if the byte is invalid
|
||||
if (byte < 0) return {};
|
||||
|
||||
@@ -31,7 +31,7 @@ climate::ClimateTraits PanasonicHeatpumpClimate::traits() {
|
||||
|
||||
void PanasonicHeatpumpClimate::control(const climate::ClimateCall& call) {
|
||||
if (call.get_mode().has_value()) {
|
||||
int byte6 = this->parent_->getResponseByte(6);
|
||||
int byte6 = this->parent_->get_response_byte(6);
|
||||
if (byte6 >= 0) {
|
||||
climate::ClimateMode new_mode = *call.get_mode();
|
||||
uint8_t newByte6 = this->setClimateMode(new_mode, (uint8_t)byte6);
|
||||
|
||||
@@ -273,13 +273,13 @@ void PanasonicHeatpumpComponent::read_request() {
|
||||
}
|
||||
}
|
||||
|
||||
int PanasonicHeatpumpComponent::getResponseByte(const int index) {
|
||||
int PanasonicHeatpumpComponent::get_response_byte(const int index) {
|
||||
if (this->heatpump_default_message_.size() > index)
|
||||
return this->heatpump_default_message_[index];
|
||||
return -1;
|
||||
}
|
||||
|
||||
int PanasonicHeatpumpComponent::getExtraResponseByte(const int index) {
|
||||
int PanasonicHeatpumpComponent::get_extra_response_byte(const int index) {
|
||||
if (this->heatpump_extra_message_.size() > index)
|
||||
return this->heatpump_extra_message_[index];
|
||||
return -1;
|
||||
|
||||
@@ -87,8 +87,8 @@ class PanasonicHeatpumpComponent : public PollingComponent, public uart::UARTDev
|
||||
this->log_uart_msg_ = active;
|
||||
}
|
||||
// uart message variables to use in lambda functions
|
||||
int getResponseByte(const int index);
|
||||
int getExtraResponseByte(const int index);
|
||||
int get_response_byte(const int index);
|
||||
int get_extra_response_byte(const int index);
|
||||
// command functions
|
||||
void set_command_high_nibble(const uint8_t value, const uint8_t index);
|
||||
void set_command_low_nibble(const uint8_t value, const uint8_t index);
|
||||
|
||||
@@ -23,7 +23,7 @@ water_heater::WaterHeaterTraits PanasonicHeatpumpWaterHeater::traits() {
|
||||
|
||||
void PanasonicHeatpumpWaterHeater::control(const water_heater::WaterHeaterCall& call) {
|
||||
if (call.get_mode().has_value()) {
|
||||
int byte6 = this->parent_->getResponseByte(6);
|
||||
int byte6 = this->parent_->get_response_byte(6);
|
||||
if (byte6 >= 0) {
|
||||
water_heater::WaterHeaterMode new_mode = *call.get_mode();
|
||||
uint8_t newByte6 = this->setWaterHeaterMode(new_mode, (uint8_t)byte6);
|
||||
|
||||
Reference in New Issue
Block a user