update "Can't convert" warning to match others in homeassistant_sensor (#5162)

This commit is contained in:
PlainTechEnthusiast 2023-07-30 17:40:55 -04:00 committed by GitHub
parent ccb3d3d308
commit 9aa5ee3372
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ void HomeassistantSensor::setup() {
this->entity_id_, this->attribute_, [this](const std::string &state) { this->entity_id_, this->attribute_, [this](const std::string &state) {
auto val = parse_number<float>(state); auto val = parse_number<float>(state);
if (!val.has_value()) { if (!val.has_value()) {
ESP_LOGW(TAG, "Can't convert '%s' to number!", state.c_str()); ESP_LOGW(TAG, "'%s': Can't convert '%s' to number!", this->entity_id_.c_str(), state.c_str());
this->publish_state(NAN); this->publish_state(NAN);
return; return;
} }