app_status: Remove "inverted", because this can already be done using binary_sensor filters
This commit is contained in:
@@ -12,7 +12,7 @@ void AppStatus::setup() {
|
||||
}
|
||||
|
||||
void AppStatus::update() {
|
||||
ESP_LOGV(TAG, "update() called; inverted = %s", TRUEFALSE(this->inverted_));
|
||||
ESP_LOGV(TAG, "update() called", TRUEFALSE(this->inverted_));
|
||||
bool result = false;
|
||||
auto app_state = App.get_app_state() & STATUS_LED_MASK;
|
||||
if (this->include_errors_ && (app_state & STATUS_LED_ERROR)) {
|
||||
@@ -21,15 +21,11 @@ void AppStatus::update() {
|
||||
if (this->include_warnings_ && (app_state & STATUS_LED_WARNING)) {
|
||||
result = true;
|
||||
}
|
||||
if (this->inverted_) {
|
||||
result = !result;
|
||||
}
|
||||
this->publish_state(result);
|
||||
}
|
||||
|
||||
void AppStatus::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "App status binary sensor");
|
||||
ESP_LOGCONFIG(TAG, " inverted = %s", TRUEFALSE(this->inverted_));
|
||||
ESP_LOGCONFIG(TAG, " include warnings = %s", TRUEFALSE(this->include_warnings_));
|
||||
ESP_LOGCONFIG(TAG, " include errors = %s", TRUEFALSE(this->include_errors_));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user