Skip to content

Commit

Permalink
Merge pull request #150 from PiBrewing/development
Browse files Browse the repository at this point in the history
Merge 4.4.7 from development
  • Loading branch information
avollkopf authored Dec 20, 2024
2 parents f39ad48 + 7c93bd2 commit e823ddd
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion cbpi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = "4.4.6"
__version__ = "4.4.7"
__codename__ = "Yeast Starter"

8 changes: 7 additions & 1 deletion cbpi/api/dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 5 additions & 2 deletions cbpi/controller/basic_controller2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -49,6 +49,7 @@ async def load(self):
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:
Expand Down Expand Up @@ -129,7 +130,9 @@ async def start(self, id):

# 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))
Expand Down
2 changes: 1 addition & 1 deletion cbpi/controller/upload_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ async def FileUpload(self, data):
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':
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
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",
Expand All @@ -48,8 +48,8 @@
"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",
Expand Down

0 comments on commit e823ddd

Please sign in to comment.