Merge pull request #150 from PiBrewing/development

Merge 4.4.7 from development
This commit is contained in:
Alexander Vollkopf 2024-12-20 12:19:14 +01:00 committed by GitHub
commit e823dddb37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 25 additions and 15 deletions

View file

@ -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

View file

@ -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)

View file

@ -1,3 +1,3 @@
__version__ = "4.4.6"
__version__ = "4.4.7"
__codename__ = "Yeast Starter"

View file

@ -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"

View file

@ -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))

View file

@ -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':

View file

@ -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

View file

@ -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",