Do not write state if payload is ''

pull/79417/head
jbouwh 2022-10-01 15:11:54 +00:00
parent ec8901b9af
commit 869c11884e
1 changed files with 2 additions and 2 deletions

View File

@ -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)