From 0c4de2bc97ebc75130aa04f391b202793ebba9bb Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Sat, 19 Feb 2022 14:11:01 +0100 Subject: [PATCH] Publish NAN when dallas conversion failed (#3227) --- esphome/components/dallas/dallas_component.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esphome/components/dallas/dallas_component.cpp b/esphome/components/dallas/dallas_component.cpp index 1eed2ebf78..6240983798 100644 --- a/esphome/components/dallas/dallas_component.cpp +++ b/esphome/components/dallas/dallas_component.cpp @@ -110,6 +110,9 @@ void DallasComponent::update() { if (!result) { ESP_LOGE(TAG, "Requesting conversion failed"); this->status_set_warning(); + for (auto *sensor : this->sensors_) { + sensor->publish_state(NAN); + } return; }