Properly fetch and display errors

This commit is contained in:
sqozz 2024-09-18 14:09:07 +02:00
parent cf41d224ea
commit d79ddf918c

View file

@ -158,11 +158,13 @@ void tw7100Component::loop() {
std::pair<std::string, std::string> parsed_response = parse_response(response); std::pair<std::string, std::string> parsed_response = parse_response(response);
if (parsed_response.first == "ERR" && parsed_response.second == "ERR") { if (parsed_response.first == "ERR" && parsed_response.second == "ERR") {
if (powered_->state) {; if (powered_->state) {;
cmd_queue.push_back("ERR?"); // TODO: produces a ERR? loop on bootup if projector is turned off ESP_LOGW(TAG, "found ERR response, pushing request to fetch full error");
cmd_queue.push_front("ERR?"); // TODO: produces a ERR? loop on bootup if projector is turned off
} else { } else {
ESP_LOGE(TAG, "got ERR while projector is off, check if PWR+LAMP is too much?"); ESP_LOGE(TAG, "got ERR while projector is off, check if PWR+LAMP is too much?");
} }
} else if (parsed_response.first == "ERR") { } else if (parsed_response.first == "ERR") {
ESP_LOGE(TAG, "found ERR report, reason is: %s", parsed_response.second.c_str());
// TODO: Handle error // TODO: Handle error
} else { } else {
update_sensor(parsed_response); update_sensor(parsed_response);