mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-22 05:24:54 +01:00
Add notifications if sensors,, actors,... can't be started
This commit is contained in:
parent
f679aabf0c
commit
e2bf72bbce
4 changed files with 7 additions and 5 deletions
|
@ -1,3 +1,3 @@
|
|||
__version__ = "4.4.7.a3"
|
||||
__version__ = "4.4.7.a4"
|
||||
__codename__ = "Yeast Starter"
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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':
|
||||
|
|
Loading…
Reference in a new issue