From 378839f4ace74722cb5efcc3785f848309393bfa Mon Sep 17 00:00:00 2001 From: avollkopf Date: Sat, 7 Dec 2024 15:07:44 +0100 Subject: [PATCH 1/9] update aiohttp requirements (dependabot) --- cbpi/__init__.py | 2 +- requirements.txt | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 893d6d2..938d993 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.6" +__version__ = "4.4.7.a1" __codename__ = "Yeast Starter" diff --git a/requirements.txt b/requirements.txt index 7e553d5..a18f9c3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ typing-extensions>=4 -aiohttp==3.10.8 +aiohttp==3.10.11 aiohttp-auth==0.1.1 aiohttp-route-decorator==0.1.4 aiohttp-security==0.5.0 diff --git a/setup.py b/setup.py index acf16f2..1a49fd0 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.10.11", "aiohttp-auth==0.1.1", "aiohttp-route-decorator==0.1.4", "aiohttp-security==0.5.0", From a62eee171d5c8d358a769314f9d504991b10a0be Mon Sep 17 00:00:00 2001 From: avollkopf Date: Sat, 7 Dec 2024 15:19:27 +0100 Subject: [PATCH 2/9] test github actions v4 --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 From 5d66521cd5276ebc19c22542f40f12d9f5fba6d0 Mon Sep 17 00:00:00 2001 From: avollkopf Date: Mon, 9 Dec 2024 11:36:07 +0100 Subject: [PATCH 3/9] update readme --- README.md | 1 + 1 file changed, 1 insertion(+) 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) From aa55033cea1592d71e46b48a95e7da13a0ecb1fd Mon Sep 17 00:00:00 2001 From: avollkopf Date: Tue, 17 Dec 2024 20:03:39 +0100 Subject: [PATCH 4/9] fix if actor plugin is not installed and actor is still in config --- cbpi/__init__.py | 2 +- cbpi/api/dataclasses.py | 5 ++++- cbpi/controller/basic_controller2.py | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 938d993..25d8167 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.7.a1" +__version__ = "4.4.7.a2" __codename__ = "Yeast Starter" diff --git a/cbpi/api/dataclasses.py b/cbpi/api/dataclasses.py index 1c403be..704ff8b 100644 --- a/cbpi/api/dataclasses.py +++ b/cbpi/api/dataclasses.py @@ -63,7 +63,10 @@ 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: + 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) + else: + return dict(id=self.id, name=self.name, type="Not Available", props=self.props.to_dict(), state=False, power=0, timer=0) class DataType(Enum): VALUE="value" diff --git a/cbpi/controller/basic_controller2.py b/cbpi/controller/basic_controller2.py index 6a4a64f..9feda96 100644 --- a/cbpi/controller/basic_controller2.py +++ b/cbpi/controller/basic_controller2.py @@ -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: From 47f5e82e774209bb76637882ee51e028f1b44b3d Mon Sep 17 00:00:00 2001 From: avollkopf Date: Tue, 17 Dec 2024 21:16:52 +0100 Subject: [PATCH 5/9] adapt missing actor type in dataclass to other dataclasses --- cbpi/__init__.py | 2 +- cbpi/api/dataclasses.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index 25d8167..c2c20b4 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.7.a2" +__version__ = "4.4.7.a3" __codename__ = "Yeast Starter" diff --git a/cbpi/api/dataclasses.py b/cbpi/api/dataclasses.py index 704ff8b..014756e 100644 --- a/cbpi/api/dataclasses.py +++ b/cbpi/api/dataclasses.py @@ -63,10 +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): - if self.instance: - 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() + type = self.type else: - return dict(id=self.id, name=self.name, type="Not Available", props=self.props.to_dict(), state=False, power=0, timer=0) + state = False + type = "!!! MISSING TYPE !!!" + return dict(id=self.id, name=self.name, type=type, props=self.props.to_dict(), state=state, power=self.power, timer=self.timer) class DataType(Enum): VALUE="value" From f679aabf0c32e2e9a03aa098cc05136925c03a9f Mon Sep 17 00:00:00 2001 From: avollkopf Date: Tue, 17 Dec 2024 21:19:33 +0100 Subject: [PATCH 6/9] replace type with actortype variable --- cbpi/api/dataclasses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cbpi/api/dataclasses.py b/cbpi/api/dataclasses.py index 014756e..c0bf08e 100644 --- a/cbpi/api/dataclasses.py +++ b/cbpi/api/dataclasses.py @@ -65,11 +65,11 @@ class Actor: def to_dict(self): if self.instance is not None: state = self.instance.get_state() - type = self.type + actortype = self.type else: state = False - type = "!!! MISSING TYPE !!!" - return dict(id=self.id, name=self.name, type=type, props=self.props.to_dict(), state=state, power=self.power, timer=self.timer) + actortype = "!!! 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" From e2bf72bbce93115b40135a601602419cd190a2a7 Mon Sep 17 00:00:00 2001 From: avollkopf Date: Wed, 18 Dec 2024 20:01:01 +0100 Subject: [PATCH 7/9] Add notifications if sensors,, actors,... can't be started --- cbpi/__init__.py | 2 +- cbpi/api/dataclasses.py | 2 +- cbpi/controller/basic_controller2.py | 6 ++++-- cbpi/controller/upload_controller.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index c2c20b4..b9bd64c 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.7.a3" +__version__ = "4.4.7.a4" __codename__ = "Yeast Starter" diff --git a/cbpi/api/dataclasses.py b/cbpi/api/dataclasses.py index c0bf08e..4515012 100644 --- a/cbpi/api/dataclasses.py +++ b/cbpi/api/dataclasses.py @@ -68,7 +68,7 @@ class Actor: actortype = self.type else: state = False - actortype = "!!! MISSING TYPE !!!" + 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): diff --git a/cbpi/controller/basic_controller2.py b/cbpi/controller/basic_controller2.py index 9feda96..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 @@ -130,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': From e5b3954069b29b2817dddbdb6f89d173b4895999 Mon Sep 17 00:00:00 2001 From: avollkopf Date: Thu, 19 Dec 2024 17:47:35 +0100 Subject: [PATCH 8/9] update requirements --- cbpi/__init__.py | 2 +- requirements.txt | 6 +++--- setup.py | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index b9bd64c..bbc03cd 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.7.a4" +__version__ = "4.4.7.a5" __codename__ = "Yeast Starter" diff --git a/requirements.txt b/requirements.txt index a18f9c3..8e82580 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ typing-extensions>=4 -aiohttp==3.10.11 +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 1a49fd0..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.11", + "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", From 7c93bd24e031b5769415a2863cf5a4fa39001698 Mon Sep 17 00:00:00 2001 From: avollkopf Date: Fri, 20 Dec 2024 12:15:13 +0100 Subject: [PATCH 9/9] Version to 4.4.7 release (update requirements and stabilization) --- cbpi/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbpi/__init__.py b/cbpi/__init__.py index bbc03cd..930c1a7 100644 --- a/cbpi/__init__.py +++ b/cbpi/__init__.py @@ -1,3 +1,3 @@ -__version__ = "4.4.7.a5" +__version__ = "4.4.7" __codename__ = "Yeast Starter"