1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-28 21:48:16 +00:00

Update mcp4461.cpp

This commit is contained in:
Oliver Kleinecke 2025-02-06 16:15:28 +01:00 committed by GitHub
parent d26aa89ffa
commit 97d99b4bed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
}