Ignore an '' value_template result for MQTT sensor (#79417)
Do not write state if payload is ''pull/79423/head
parent
31ddf6cc31
commit
9c9c8b324a
|
@ -271,8 +271,8 @@ class MqttSensor(MqttEntity, RestoreSensor):
|
|||
)
|
||||
elif self.device_class == SensorDeviceClass.DATE:
|
||||
payload = payload.date()
|
||||
|
||||
self._state = payload
|
||||
if payload != "":
|
||||
self._state = payload
|
||||
|
||||
def _update_last_reset(msg):
|
||||
payload = self._last_reset_template(msg.payload)
|
||||
|
|
Loading…
Reference in New Issue