mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-28 17:54:15 +01:00
"fix static config"
This commit is contained in:
parent
6a091c0bae
commit
f1bcd1e543
3 changed files with 11 additions and 9 deletions
|
@ -1 +1 @@
|
||||||
__version__ = "4.0.0.23"
|
__version__ = "4.0.0.24"
|
|
@ -15,6 +15,7 @@ class ConfigController:
|
||||||
self.cbpi = cbpi
|
self.cbpi = cbpi
|
||||||
self.cbpi.register(self)
|
self.cbpi.register(self)
|
||||||
self.path = os.path.join(".", 'config', "config.json")
|
self.path = os.path.join(".", 'config', "config.json")
|
||||||
|
self.path_static = os.path.join(".", 'config', "config.yaml")
|
||||||
|
|
||||||
def get_state(self):
|
def get_state(self):
|
||||||
|
|
||||||
|
@ -26,6 +27,7 @@ class ConfigController:
|
||||||
|
|
||||||
|
|
||||||
async def init(self):
|
async def init(self):
|
||||||
|
self.static = load_config(self.path_static)
|
||||||
with open(self.path) as json_file:
|
with open(self.path) as json_file:
|
||||||
data = json.load(json_file)
|
data = json.load(json_file)
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
|
|
|
@ -22,7 +22,7 @@ class MashStep(CBPiStep):
|
||||||
|
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(10,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
self.summary = "Waiting for Target Temp"
|
self.summary = "Waiting for Target Temp"
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ class MashStep(CBPiStep):
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
async def reset(self):
|
async def reset(self):
|
||||||
self.timer = Timer(10,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
while True:
|
while True:
|
||||||
|
@ -55,7 +55,7 @@ class WaitStep(CBPiStep):
|
||||||
|
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(int(self.props.Timer),on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) * 60,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
|
|
||||||
async def on_stop(self):
|
async def on_stop(self):
|
||||||
|
@ -64,7 +64,7 @@ class WaitStep(CBPiStep):
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
async def reset(self):
|
async def reset(self):
|
||||||
self.timer = Timer(int(self.props.Timer),on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) * 60,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
while True:
|
while True:
|
||||||
|
@ -84,7 +84,7 @@ class ActorStep(CBPiStep):
|
||||||
|
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(int(self.props.Timer),on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) * 60,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
self.timer.start()
|
self.timer.start()
|
||||||
await self.actor_on(self.props.Actor)
|
await self.actor_on(self.props.Actor)
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class ActorStep(CBPiStep):
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
async def reset(self):
|
async def reset(self):
|
||||||
self.timer = Timer(int(self.props.Timer),on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ class BoilStep(CBPiStep):
|
||||||
|
|
||||||
async def on_start(self):
|
async def on_start(self):
|
||||||
if self.timer is None:
|
if self.timer is None:
|
||||||
self.timer = Timer(10,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
|
||||||
self.summary = "Waiting for Target Temp"
|
self.summary = "Waiting for Target Temp"
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
@ -131,7 +131,7 @@ class BoilStep(CBPiStep):
|
||||||
await self.push_update()
|
await self.push_update()
|
||||||
|
|
||||||
async def reset(self):
|
async def reset(self):
|
||||||
self.timer = Timer(10,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
self.timer = Timer(int(self.props.Timer) *60 ,on_update=self.on_timer_update, on_done=self.on_timer_done)
|
||||||
|
|
||||||
@action("Start Timer", [])
|
@action("Start Timer", [])
|
||||||
async def star_timer(self):
|
async def star_timer(self):
|
||||||
|
|
Loading…
Reference in a new issue