mirror of
https://github.com/esphome/esphome.git
synced 2025-03-31 16:08:15 +01:00
Update mcp4461.cpp
This commit is contained in:
parent
d26aa89ffa
commit
97d99b4bed
@ -131,7 +131,7 @@ void Mcp4461Component::loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Mcp4461Component::get_status_register() {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -187,7 +187,7 @@ uint8_t Mcp4461Component::get_wiper_address_(uint8_t wiper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Mcp4461Component::get_wiper_level(Mcp4461WiperIdx 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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -228,7 +228,7 @@ void Mcp4461Component::update_wiper_level(Mcp4461WiperIdx wiper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::set_wiper_level(Mcp4461WiperIdx wiper, uint16_t value) {
|
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.");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting write.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ void Mcp4461Component::write_wiper_level_(uint8_t wiper, uint16_t value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) {
|
void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) {
|
||||||
if (this->parent_->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ void Mcp4461Component::enable_wiper(Mcp4461WiperIdx wiper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::disable_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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ void Mcp4461Component::disable_wiper(Mcp4461WiperIdx wiper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::increase_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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -310,7 +310,7 @@ void Mcp4461Component::increase_wiper(Mcp4461WiperIdx wiper) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::decrease_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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -358,7 +358,7 @@ uint8_t Mcp4461Component::calc_terminal_connector_byte_(Mcp4461TerminalIdx termi
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t Mcp4461Component::get_terminal_register(Mcp4461TerminalIdx terminal_connector) {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0");
|
||||||
return 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) {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -426,7 +426,7 @@ void Mcp4461Component::set_terminal_register(Mcp4461TerminalIdx terminal_connect
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::enable_terminal(Mcp4461WiperIdx wiper, char terminal) {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -457,7 +457,7 @@ void Mcp4461Component::enable_terminal(Mcp4461WiperIdx wiper, char terminal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Mcp4461Component::disable_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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -488,7 +488,7 @@ void Mcp4461Component::disable_terminal(Mcp4461WiperIdx wiper, char terminal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint16_t Mcp4461Component::get_eeprom_value(Mcp4461EepromLocation location) {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Returning 0");
|
||||||
return 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) {
|
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");
|
ESP_LOGW(TAG, "Parent MCP4461 component has failed! Aborting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user