remove db and update get async loop

This commit is contained in:
Manuel Fritsch 2022-03-06 14:39:52 +01:00
commit 3b81f1d844
3 changed files with 3 additions and 4 deletions

View file

@ -175,7 +175,7 @@ def check_for_setup():
zip.extractall(output_path) zip.extractall(output_path)
zip.close() zip.close()
if system != "Windows": if system != "Windows":
print("Changing owner and group of config folder recursively to {}:{}".format(owner,group)) print(f"Changing owner and group of config folder recursively to {owner}:{group}")
recursive_chown(output_path, owner, group) recursive_chown(output_path, owner, group)
print("Removing backup file") print("Removing backup file")
os.remove(backupfile) os.remove(backupfile)

View file

@ -95,7 +95,7 @@ class FermentationController:
self.cbpi = cbpi self.cbpi = cbpi
self.logger = logging.getLogger(__name__) self.logger = logging.getLogger(__name__)
self.path = os.path.join(".", 'config', "fermenter_data.json") self.path = os.path.join(".", 'config', "fermenter_data.json")
self._loop = asyncio.get_event_loop()
self.data = [] self.data = []
self.types = {} self.types = {}
self.steptypes = {} self.steptypes = {}
@ -472,7 +472,7 @@ class FermentationController:
await item.instance.start() await item.instance.start()
item.instance.running = True item.instance.running = True
item.instance.task = self._loop.create_task(item.instance._run()) item.instance.task = asyncio.get_event_loop().create_task(item.instance._run())
logging.info("{} started {}".format(item.name, id)) logging.info("{} started {}".format(item.name, id))

View file

@ -88,7 +88,6 @@ class CraftBeerPi:
self.static_config = load_config(os.path.join(".", 'config', "config.yaml")) self.static_config = load_config(os.path.join(".", 'config', "config.yaml"))
self.database_file = os.path.join(".", 'config', "craftbeerpi.db")
logger.info("Init CraftBeerPI") logger.info("Init CraftBeerPI")
policy = auth.SessionTktAuthentication(urandom(32), 60, include_ip=True) policy = auth.SessionTktAuthentication(urandom(32), 60, include_ip=True)