diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c880778..1e1b509 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup python environment - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: '3.11' @@ -43,7 +43,7 @@ jobs: run: python setup.py sdist - name: Upload CraftBeerPi package to be used in next step - uses: actions/upload-artifact@v2.2.4 + uses: actions/upload-artifact@v4 with: name: craftbeerpi4 path: dist/cbpi4-*.tar.gz @@ -54,7 +54,7 @@ jobs: name: Builds the docker image(s) steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Prepare docker image and tag names id: prep diff --git a/README.md b/README.md index 675f77b..74cde31 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build](https://github.com/PiBrewing/craftbeerpi4/actions/workflows/build.yml/badge.svg)](https://github.com/PiBrewing/craftbeerpi4/actions/workflows/build.yml) [![GitHub license](https://img.shields.io/github/license/PiBrewing/craftbeerpi4)](https://github.com/PiBrewing/craftbeerpi4/blob/master/LICENSE) ![GitHub issues](https://img.shields.io/github/issues-raw/PiBrewing/craftbeerpi4) +[![GitHub Activity](https://img.shields.io/github/commit-activity/y/PiBrewing/craftbeerpi4.svg?label=commits)](https://github.com/PiBrewing/craftbeerpi4/commits) ![PyPI](https://img.shields.io/pypi/v/cbpi4) ![Happy Brewing](https://img.shields.io/badge/CraftBeerPi%204-Happy%20Brewing-%23FBB117) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 893d6d2..930c1a7 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.6" +__version__ = "4.4.7" __codename__ = "Yeast Starter" diff --git a/cbpi/api/dataclasses.py b/cbpi/api/dataclasses.py index 1c403be..4515012 100644 --- a/cbpi/api/dataclasses.py +++ b/cbpi/api/dataclasses.py @@ -63,7 +63,13 @@ class Actor: def __str__(self): return "name={} props={}, state={}, type={}, power={}, timer={}".format(self.name, self.props, self.state, self.type, self.power, self.timer) def to_dict(self): - return dict(id=self.id, name=self.name, type=self.type, props=self.props.to_dict(), state=self.instance.get_state(), power=self.power, timer=self.timer) + if self.instance is not None: + state = self.instance.get_state() + actortype = self.type + else: + state = False + actortype = self.type # !!! MISSING TYPE !!! + return dict(id=self.id, name=self.name, type=actortype, props=self.props.to_dict(), state=state, power=self.power, timer=self.timer) class DataType(Enum): VALUE="value" diff --git a/cbpi/controller/basic_controller2.py b/cbpi/controller/basic_controller2.py index 6a4a64f..a7f7f82 100644 --- a/cbpi/controller/basic_controller2.py +++ b/cbpi/controller/basic_controller2.py @@ -2,7 +2,7 @@ import logging import os.path import json -from cbpi.api.dataclasses import Fermenter, Actor, Props +from cbpi.api.dataclasses import Fermenter, Actor, Props, NotificationType import sys, os import shortuuid import asyncio @@ -49,6 +49,7 @@ class BasicController: await self.start(item.id) await self.push_udpate() except Exception as e: + #logging.error(e) logging.warning("Invalid {} file - Creating empty file".format(self.path)) os.remove(self.path) with open(self.path, "w") as file: @@ -129,7 +130,9 @@ class BasicController: # await self.push_udpate() except Exception as e: - logging.error("{} Cant start {} - {}".format(self.name, id, e)) + line="{} Cant start {} - {}".format(self.name, id, e) + logging.error(line) + self.cbpi.notify("Error", line, NotificationType.ERROR) def get_types(self): # logging.info("{} Get Types".format(self.name)) diff --git a/cbpi/controller/upload_controller.py b/cbpi/controller/upload_controller.py index f3614dc..0e267d2 100644 --- a/cbpi/controller/upload_controller.py +++ b/cbpi/controller/upload_controller.py @@ -170,7 +170,7 @@ class UploadController: f.close() self.cbpi.notify("Success", "XML Recipe {} has been uploaded".format(filename), NotificationType.SUCCESS) except Exception as e: - self.cbpi.notify("Error" "XML Recipe upload failed: {}".format(e), NotificationType.ERROR) + self.cbpi.notify("Error", "XML Recipe upload failed: {}".format(e), NotificationType.ERROR) pass elif content_type == 'application/json': diff --git a/requirements.txt b/requirements.txt index 7e553d5..8e82580 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ typing-extensions>=4 -aiohttp==3.10.8 +aiohttp==3.11.11 aiohttp-auth==0.1.1 aiohttp-route-decorator==0.1.4 aiohttp-security==0.5.0 @@ -8,8 +8,8 @@ aiohttp-swagger==1.0.16 async-timeout==4.0.3 aiojobs==1.2.1 aiosqlite==0.17.0 -cryptography==43.0.1 -pyopenssl==24.2.1 +cryptography==44.0.0 +pyopenssl==24.3.0 requests==2.32.2 voluptuous==0.14.2 pyfiglet==1.0.2 diff --git a/setup.py b/setup.py index acf16f2..63e5e50 100644 --- a/setup.py +++ b/setup.py @@ -39,7 +39,7 @@ setup(name='cbpi4', long_description_content_type='text/markdown', install_requires=[ "typing-extensions>=4", - "aiohttp==3.10.8", + "aiohttp==3.11.11", "aiohttp-auth==0.1.1", "aiohttp-route-decorator==0.1.4", "aiohttp-security==0.5.0", @@ -48,8 +48,8 @@ setup(name='cbpi4', "async-timeout==4.0.3", "aiojobs==1.2.1 ", "aiosqlite==0.17.0", - "cryptography==43.0.1", - "pyopenssl==24.2.1", + "cryptography==44.0.0", + "pyopenssl==24.3.0", "requests==2.32.2", "voluptuous==0.14.2", "pyfiglet==1.0.2",