mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-22 13:34:55 +01:00
timer fix
This commit is contained in:
parent
bffa3c36e3
commit
f5e6b22f01
2 changed files with 5 additions and 3 deletions
|
@ -1,3 +1,3 @@
|
|||
__version__ = "4.1.6.b4"
|
||||
__version__ = "4.1.6.b5"
|
||||
__codename__ = "Groundhog Day"
|
||||
|
||||
|
|
|
@ -27,9 +27,10 @@ class AlarmTimer(CBPiSensor):
|
|||
self.stopped=False
|
||||
self.time = float(time)
|
||||
self.value=self.calculate_time(self.time)
|
||||
if self.timer is None:
|
||||
if self.timer is not None:
|
||||
await self.timer.stop()
|
||||
self.timer = Timer(int(self.time * 60), on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||
await self.timer.stop()
|
||||
self.timer.is_running = False
|
||||
logging.info("Set Timer")
|
||||
|
||||
|
@ -55,10 +56,11 @@ class AlarmTimer(CBPiSensor):
|
|||
@action(key="Reset Timer", parameters=[])
|
||||
async def Reset(self , **kwargs):
|
||||
self.stopped=False
|
||||
if self.timer is None:
|
||||
if self.timer is not None:
|
||||
await self.timer.stop()
|
||||
self.value=self.calculate_time(self.time)
|
||||
self.timer = Timer(int(self.time * 60), on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||
await self.timer.stop()
|
||||
self.timer.is_running = False
|
||||
logging.info("Reset Timer")
|
||||
|
||||
|
|
Loading…
Reference in a new issue