mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-22 13:34:55 +01:00
Merge pull request #150 from PiBrewing/development
Merge 4.4.7 from development
This commit is contained in:
commit
e823dddb37
8 changed files with 25 additions and 15 deletions
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
|
@ -20,10 +20,10 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout source
|
- name: Checkout source
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup python environment
|
- name: Setup python environment
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ jobs:
|
||||||
run: python setup.py sdist
|
run: python setup.py sdist
|
||||||
|
|
||||||
- name: Upload CraftBeerPi package to be used in next step
|
- name: Upload CraftBeerPi package to be used in next step
|
||||||
uses: actions/upload-artifact@v2.2.4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: craftbeerpi4
|
name: craftbeerpi4
|
||||||
path: dist/cbpi4-*.tar.gz
|
path: dist/cbpi4-*.tar.gz
|
||||||
|
@ -54,7 +54,7 @@ jobs:
|
||||||
name: Builds the docker image(s)
|
name: Builds the docker image(s)
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Prepare docker image and tag names
|
- name: Prepare docker image and tag names
|
||||||
id: prep
|
id: prep
|
||||||
|
|
|
@ -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)
|
[![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 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 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)
|
![PyPI](https://img.shields.io/pypi/v/cbpi4)
|
||||||
![Happy Brewing](https://img.shields.io/badge/CraftBeerPi%204-Happy%20Brewing-%23FBB117)
|
![Happy Brewing](https://img.shields.io/badge/CraftBeerPi%204-Happy%20Brewing-%23FBB117)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
__version__ = "4.4.6"
|
__version__ = "4.4.7"
|
||||||
__codename__ = "Yeast Starter"
|
__codename__ = "Yeast Starter"
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,13 @@ class Actor:
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "name={} props={}, state={}, type={}, power={}, timer={}".format(self.name, self.props, self.state, self.type, self.power, self.timer)
|
return "name={} props={}, state={}, type={}, power={}, timer={}".format(self.name, self.props, self.state, self.type, self.power, self.timer)
|
||||||
def to_dict(self):
|
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):
|
class DataType(Enum):
|
||||||
VALUE="value"
|
VALUE="value"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import logging
|
import logging
|
||||||
import os.path
|
import os.path
|
||||||
import json
|
import json
|
||||||
from cbpi.api.dataclasses import Fermenter, Actor, Props
|
from cbpi.api.dataclasses import Fermenter, Actor, Props, NotificationType
|
||||||
import sys, os
|
import sys, os
|
||||||
import shortuuid
|
import shortuuid
|
||||||
import asyncio
|
import asyncio
|
||||||
|
@ -49,6 +49,7 @@ class BasicController:
|
||||||
await self.start(item.id)
|
await self.start(item.id)
|
||||||
await self.push_udpate()
|
await self.push_udpate()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
#logging.error(e)
|
||||||
logging.warning("Invalid {} file - Creating empty file".format(self.path))
|
logging.warning("Invalid {} file - Creating empty file".format(self.path))
|
||||||
os.remove(self.path)
|
os.remove(self.path)
|
||||||
with open(self.path, "w") as file:
|
with open(self.path, "w") as file:
|
||||||
|
@ -129,7 +130,9 @@ class BasicController:
|
||||||
|
|
||||||
# await self.push_udpate()
|
# await self.push_udpate()
|
||||||
except Exception as e:
|
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):
|
def get_types(self):
|
||||||
# logging.info("{} Get Types".format(self.name))
|
# logging.info("{} Get Types".format(self.name))
|
||||||
|
|
|
@ -170,7 +170,7 @@ class UploadController:
|
||||||
f.close()
|
f.close()
|
||||||
self.cbpi.notify("Success", "XML Recipe {} has been uploaded".format(filename), NotificationType.SUCCESS)
|
self.cbpi.notify("Success", "XML Recipe {} has been uploaded".format(filename), NotificationType.SUCCESS)
|
||||||
except Exception as e:
|
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
|
pass
|
||||||
|
|
||||||
elif content_type == 'application/json':
|
elif content_type == 'application/json':
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
typing-extensions>=4
|
typing-extensions>=4
|
||||||
aiohttp==3.10.8
|
aiohttp==3.11.11
|
||||||
aiohttp-auth==0.1.1
|
aiohttp-auth==0.1.1
|
||||||
aiohttp-route-decorator==0.1.4
|
aiohttp-route-decorator==0.1.4
|
||||||
aiohttp-security==0.5.0
|
aiohttp-security==0.5.0
|
||||||
|
@ -8,8 +8,8 @@ aiohttp-swagger==1.0.16
|
||||||
async-timeout==4.0.3
|
async-timeout==4.0.3
|
||||||
aiojobs==1.2.1
|
aiojobs==1.2.1
|
||||||
aiosqlite==0.17.0
|
aiosqlite==0.17.0
|
||||||
cryptography==43.0.1
|
cryptography==44.0.0
|
||||||
pyopenssl==24.2.1
|
pyopenssl==24.3.0
|
||||||
requests==2.32.2
|
requests==2.32.2
|
||||||
voluptuous==0.14.2
|
voluptuous==0.14.2
|
||||||
pyfiglet==1.0.2
|
pyfiglet==1.0.2
|
||||||
|
|
6
setup.py
6
setup.py
|
@ -39,7 +39,7 @@ setup(name='cbpi4',
|
||||||
long_description_content_type='text/markdown',
|
long_description_content_type='text/markdown',
|
||||||
install_requires=[
|
install_requires=[
|
||||||
"typing-extensions>=4",
|
"typing-extensions>=4",
|
||||||
"aiohttp==3.10.8",
|
"aiohttp==3.11.11",
|
||||||
"aiohttp-auth==0.1.1",
|
"aiohttp-auth==0.1.1",
|
||||||
"aiohttp-route-decorator==0.1.4",
|
"aiohttp-route-decorator==0.1.4",
|
||||||
"aiohttp-security==0.5.0",
|
"aiohttp-security==0.5.0",
|
||||||
|
@ -48,8 +48,8 @@ setup(name='cbpi4',
|
||||||
"async-timeout==4.0.3",
|
"async-timeout==4.0.3",
|
||||||
"aiojobs==1.2.1 ",
|
"aiojobs==1.2.1 ",
|
||||||
"aiosqlite==0.17.0",
|
"aiosqlite==0.17.0",
|
||||||
"cryptography==43.0.1",
|
"cryptography==44.0.0",
|
||||||
"pyopenssl==24.2.1",
|
"pyopenssl==24.3.0",
|
||||||
"requests==2.32.2",
|
"requests==2.32.2",
|
||||||
"voluptuous==0.14.2",
|
"voluptuous==0.14.2",
|
||||||
"pyfiglet==1.0.2",
|
"pyfiglet==1.0.2",
|
||||||
|
|
Loading…
Reference in a new issue