From 97d99b4bedfc9da25077312e1d002e8ce7e3fb20 Mon Sep 17 00:00:00 2001 From: Oliver Kleinecke Date: Thu, 6 Feb 2025 16:15:28 +0100 Subject: [PATCH] Update mcp4461.cpp --- esphome/components/mcp4461/mcp4461.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/esphome/components/mcp4461/mcp4461.cpp b/esphome/components/mcp4461/mcp4461.cpp index a9c8df71d2..654a0b5fa9 100644 --- a/esphome/components/mcp4461/mcp4461.cpp +++ b/esphome/components/mcp4461/mcp4461.cpp @@ -131,7 +131,7 @@ void Mcp4461Component::loop() { } uint8_t Mcp4461Component::get_status_register() { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0"); return 0; } @@ -187,7 +187,7 @@ uint8_t Mcp4461Component::get_wiper_address_(uint8_t wiper) { } uint16_t Mcp4461Component::get_wiper_level(Mcp4461WiperIdx wiper) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0"); return 0; } @@ -228,7 +228,7 @@ void Mcp4461Component::update_wiper_level(Mcp4461WiperIdx wiper) { } void Mcp4461Component::set_wiper_level(Mcp4461WiperIdx wiper, uint16_t value) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting write."); return; } @@ -264,7 +264,7 @@ void Mcp4461Component::write_wiper_level_(uint8_t wiper, uint16_t value) { } void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -275,7 +275,7 @@ void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) { } void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -286,7 +286,7 @@ void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) { } void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -310,7 +310,7 @@ void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) { } void Mcp4461Component::decrease_wiper(Mcp4461WiperIdx wiper) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -358,7 +358,7 @@ uint8_t Mcp4461Component::calc_terminal_connector_byte_(Mcp4461TerminalIdx termi } uint8_t Mcp4461Component::get_terminal_register(Mcp4461TerminalIdx terminal_connector) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0"); return 0; } @@ -405,7 +405,7 @@ void Mcp4461Component::update_terminal_register(Mcp4461TerminalIdx terminal_conn } void Mcp4461Component::set_terminal_register(Mcp4461TerminalIdx terminal_connector, uint8_t data) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -426,7 +426,7 @@ void Mcp4461Component::set_terminal_register(Mcp4461TerminalIdx terminal_connect } void Mcp4461Component::enable_terminal(Mcp4461WiperIdx wiper, char terminal) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -457,7 +457,7 @@ void Mcp4461Component::enable_terminal(Mcp4461WiperIdx wiper, char terminal) { } void Mcp4461Component::disable_terminal(Mcp4461WiperIdx wiper, char terminal) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; } @@ -488,7 +488,7 @@ void Mcp4461Component::disable_terminal(Mcp4461WiperIdx wiper, char terminal) { } uint16_t Mcp4461Component::get_eeprom_value(Mcp4461EepromLocation location) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0"); return 0; } @@ -508,7 +508,7 @@ uint16_t Mcp4461Component::get_eeprom_value(Mcp4461EepromLocation location) { } void Mcp4461Component::set_eeprom_value(Mcp4461EepromLocation location, uint16_t value) { - if (this->parent_->is_failed()) { + if (this->is_failed()) { ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting"); return; }