mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 06:33:51 +00:00 
			
		
		
		
	Update mcp4461_output.cpp
This commit is contained in:
		| @@ -8,10 +8,11 @@ namespace esphome { | ||||
| namespace mcp4461 { | ||||
|  | ||||
| static const char *const TAG = "mcp4461.output"; | ||||
| static const LogString *const LOG_PARENT_FAILED_STR = LOG_STR("Parent MCP4461 component has failed! Aborting"); | ||||
|  | ||||
| void Mcp4461Wiper::write_state(float state) { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -33,7 +34,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(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -49,7 +50,7 @@ void Mcp4461Wiper::save_level() { | ||||
|  | ||||
| void Mcp4461Wiper::enable_wiper() { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -62,7 +63,7 @@ void Mcp4461Wiper::enable_wiper() { | ||||
|  | ||||
| void Mcp4461Wiper::disable_wiper() { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -75,7 +76,7 @@ void Mcp4461Wiper::disable_wiper() { | ||||
|  | ||||
| void Mcp4461Wiper::increase_wiper() { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -90,7 +91,7 @@ void Mcp4461Wiper::increase_wiper() { | ||||
|  | ||||
| void Mcp4461Wiper::decrease_wiper() { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -105,7 +106,7 @@ void Mcp4461Wiper::decrease_wiper() { | ||||
|  | ||||
| void Mcp4461Wiper::enable_terminal(char terminal) { | ||||
|   if (this->parent_->is_failed()) { | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
| @@ -118,7 +119,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(Mcp4461Component::mcp4461_get_message_string(Mcp4461Component::MCP4461_PARENT_FAILED))); | ||||
|     ESP_LOGE(TAG, "%s", LOG_STR_ARG(LOG_PARENT_FAILED_STR); | ||||
|     return; | ||||
|   } | ||||
|   uint8_t wiper_idx = static_cast<uint8_t>(this->wiper_); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user