renamed getResponseByte to get_response_byte and getExtraResponseByte to get_extra_response_byte

This commit is contained in:
ElVit 2026-03-26 20:16:40 +01:00
parent 3a9cd04a1e
commit 8b5311450a
5 changed files with 8 additions and 8 deletions

View File

@ -664,7 +664,7 @@ sensor:
unit_of_measurement: °C unit_of_measurement: °C
lambda: |- lambda: |-
// get the requried byte // 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 // a valid byte range is 0x00-0xFF
// do not update if the byte is invalid // do not update if the byte is invalid
if (byte < 0) return {}; if (byte < 0) return {};
@ -678,7 +678,7 @@ text_sensor:
update_interval: 3s update_interval: 3s
lambda: |- lambda: |-
// get the requried byte // 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 // a valid byte range is 0x00-0xFF
// do not update if the byte is invalid // do not update if the byte is invalid
if (byte < 0) return {}; if (byte < 0) return {};

View File

@ -31,7 +31,7 @@ climate::ClimateTraits PanasonicHeatpumpClimate::traits() {
void PanasonicHeatpumpClimate::control(const climate::ClimateCall& call) { void PanasonicHeatpumpClimate::control(const climate::ClimateCall& call) {
if (call.get_mode().has_value()) { if (call.get_mode().has_value()) {
int byte6 = this->parent_->getResponseByte(6); int byte6 = this->parent_->get_response_byte(6);
if (byte6 >= 0) { if (byte6 >= 0) {
climate::ClimateMode new_mode = *call.get_mode(); climate::ClimateMode new_mode = *call.get_mode();
uint8_t newByte6 = this->setClimateMode(new_mode, (uint8_t)byte6); uint8_t newByte6 = this->setClimateMode(new_mode, (uint8_t)byte6);

View File

@ -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) if (this->heatpump_default_message_.size() > index)
return this->heatpump_default_message_[index]; return this->heatpump_default_message_[index];
return -1; return -1;
} }
int PanasonicHeatpumpComponent::getExtraResponseByte(const int index) { int PanasonicHeatpumpComponent::get_extra_response_byte(const int index) {
if (this->heatpump_extra_message_.size() > index) if (this->heatpump_extra_message_.size() > index)
return this->heatpump_extra_message_[index]; return this->heatpump_extra_message_[index];
return -1; return -1;

View File

@ -87,8 +87,8 @@ class PanasonicHeatpumpComponent : public PollingComponent, public uart::UARTDev
this->log_uart_msg_ = active; this->log_uart_msg_ = active;
} }
// uart message variables to use in lambda functions // uart message variables to use in lambda functions
int getResponseByte(const int index); int get_response_byte(const int index);
int getExtraResponseByte(const int index); int get_extra_response_byte(const int index);
// command functions // command functions
void set_command_high_nibble(const uint8_t value, const uint8_t index); 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); void set_command_low_nibble(const uint8_t value, const uint8_t index);

View File

@ -23,7 +23,7 @@ water_heater::WaterHeaterTraits PanasonicHeatpumpWaterHeater::traits() {
void PanasonicHeatpumpWaterHeater::control(const water_heater::WaterHeaterCall& call) { void PanasonicHeatpumpWaterHeater::control(const water_heater::WaterHeaterCall& call) {
if (call.get_mode().has_value()) { if (call.get_mode().has_value()) {
int byte6 = this->parent_->getResponseByte(6); int byte6 = this->parent_->get_response_byte(6);
if (byte6 >= 0) { if (byte6 >= 0) {
water_heater::WaterHeaterMode new_mode = *call.get_mode(); water_heater::WaterHeaterMode new_mode = *call.get_mode();
uint8_t newByte6 = this->setWaterHeaterMode(new_mode, (uint8_t)byte6); uint8_t newByte6 = this->setWaterHeaterMode(new_mode, (uint8_t)byte6);