missing varable in mqttsensor

This commit is contained in:
avollkopf 2023-03-27 22:31:47 +02:00
parent 54eb769fb3
commit 7df48bdf08
2 changed files with 2 additions and 1 deletions

View file

@ -1,3 +1,3 @@
__version__ = "4.1.7.rc2"
__version__ = "4.1.7.rc3"
__codename__ = "Groundhog Day"

View file

@ -129,6 +129,7 @@ class MQTTSensor(CBPiSensor):
return dict(value=self.value)
async def on_stop(self):
was_cancelled=False
if not self.mqtt_task.done():
logging.info("Task not done -> cancelling")
was_cancelled = self.mqtt_task.cancel()