mirror of
https://github.com/esphome/esphome.git
synced 2025-04-12 22:00:30 +01:00
Update mcp4461_output.cpp
This commit is contained in:
parent
cf18991015
commit
825cfa9529
@ -10,7 +10,7 @@ namespace mcp4461 {
|
||||
static const char *const TAG = "mcp4461.output";
|
||||
static const LogString *get_wiper_message_string(int status) {
|
||||
switch (status) {
|
||||
case Mcp4461Component::COMPONENT_FAILED:
|
||||
case Mcp4461Component::MCP4461_FAILED:
|
||||
return LOG_STR("Parent MCP4461 component failed");
|
||||
default:
|
||||
return LOG_STR("Unknown error");
|
||||
@ -19,7 +19,7 @@ static const LogString *get_wiper_message_string(int status) {
|
||||
|
||||
void Mcp4461Wiper::write_state(float state) {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -41,7 +41,7 @@ uint16_t Mcp4461Wiper::get_wiper_level() { return this->parent_->get_wiper_level
|
||||
|
||||
void Mcp4461Wiper::save_level() {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -57,7 +57,7 @@ void Mcp4461Wiper::save_level() {
|
||||
|
||||
void Mcp4461Wiper::enable_wiper() {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -70,7 +70,7 @@ void Mcp4461Wiper::enable_wiper() {
|
||||
|
||||
void Mcp4461Wiper::disable_wiper() {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -83,7 +83,7 @@ void Mcp4461Wiper::disable_wiper() {
|
||||
|
||||
void Mcp4461Wiper::increase_wiper() {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -98,7 +98,7 @@ void Mcp4461Wiper::increase_wiper() {
|
||||
|
||||
void Mcp4461Wiper::decrease_wiper() {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -113,7 +113,7 @@ void Mcp4461Wiper::decrease_wiper() {
|
||||
|
||||
void Mcp4461Wiper::enable_terminal(char terminal) {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
@ -126,7 +126,7 @@ void Mcp4461Wiper::enable_terminal(char terminal) {
|
||||
|
||||
void Mcp4461Wiper::disable_terminal(char terminal) {
|
||||
if (this->parent_->is_failed()) {
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::COMPONENT_FAILED)));
|
||||
ESP_LOGE(TAG, "%s", LOG_STR_ARG(get_wiper_message_string(Mcp4461Component::MCP4461_FAILED)));
|
||||
return;
|
||||
}
|
||||
uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_);
|
||||
|
Loading…
x
Reference in New Issue
Block a user