Browse Source

Merge 59b59540c8 into 837b906af1

pull/93/merge
flo269 GitHub 8 years ago
parent
commit
8d7cf3fdd7
10 changed files with 41 additions and 41 deletions
  1. +1
    -1
      README.md
  2. +10
    -10
      install.sh
  3. +15
    -15
      modules/base_plugins/brew_steps/__init__.py
  4. +2
    -2
      modules/base_plugins/gpio_actor/__init__.py
  5. +2
    -2
      modules/base_plugins/hysteresis/__init__.py
  6. +1
    -1
      modules/notification/__init__.py
  7. +3
    -3
      modules/recipe_import/beerxml.py
  8. +4
    -4
      modules/recipe_import/kbh.py
  9. +1
    -1
      modules/recipe_import/restapi.py
  10. +2
    -2
      modules/system/endpoints.py

+ 1
- 1
README.md View File

@@ -30,6 +30,6 @@ CraftBeerPi 3.0 is a complete rewrite. Server as well as user interface. I recom

## Donation

CraftBeerPi is a free & open source project. If you like to support the project I happy about a donation:
CraftBeerPi is a free & open source project. If you would like to support the project I would be happy about a donation:

[![Donate](https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=2X9KR98KJ8YZQ)

+ 10
- 10
install.sh View File

@@ -29,12 +29,12 @@ show_menu () {
if [ $BUTTON -eq 0 ]; then
case $OPTION in
1)
confirmAnswer "Would you like run apt-get update & apt-get upgrade?"
confirmAnswer "Would you like to run apt-get update & apt-get upgrade?"
if [ $? = 0 ]; then
apt-get -y update; apt-get -y upgrade;
fi

confirmAnswer "Would you like to install wiringPI? This is required to control the GPIO"
confirmAnswer "Would you like to install wiringPI? This is required to control the GPIO."
if [ $? = 0 ]; then
git clone git://git.drogon.net/wiringPi;
cd wiringPi;
@@ -48,7 +48,7 @@ show_menu () {
apt-get -y install libpcre3-dev
pip install -r requirements.txt

confirmAnswer "Would you like to add active 1-wire support at your Raspberry PI now? IMPORTANT: The 1-wire thermometer must be conneted to GPIO 4!"
confirmAnswer "Would you like to add active 1-wire support to your Raspberry PI now? IMPORTANT: The 1-wire thermometer must be conneted to GPIO 4!"
if [ $? = 0 ]; then
#apt-get -y update; apt-get -y upgrade;
echo '# CraftBeerPi 1-wire support' >> "/boot/config.txt"
@@ -65,7 +65,7 @@ show_menu () {
show_menu
;;
2)
confirmAnswer "Are you sure you want to clear the CraftBeerPi. All hardware setting will be deleted"
confirmAnswer "Are you sure you want to clear the CraftBeerPi? All hardware settings will be deleted."
if [ $? = 0 ]; then
sudo rm -f craftbeerpi.db
whiptail --title "Database Delted" --msgbox "The CraftBeerPi database was succesfully deleted. You must hit OK to continue." 8 78
@@ -75,19 +75,19 @@ show_menu () {
fi
;;
3)
confirmAnswer "Are you sure you want to add CraftBeerPi to autostart"
confirmAnswer "Are you sure you want to add CraftBeerPi to autostart?"
if [ $? = 0 ]; then
sed "s@#DIR#@${PWD}@g" config/craftbeerpiboot > /etc/init.d/craftbeerpiboot
chmod 755 /etc/init.d/craftbeerpiboot;
update-rc.d craftbeerpiboot defaults;
whiptail --title "Added succesfull to autostart" --msgbox "The CraftBeerPi was added to autostart succesfully. You must hit OK to continue." 8 78
whiptail --title "Succesfull add to autostart" --msgbox "CraftBeerPi was added to autostart succesfully. You must hit OK to continue." 8 78
show_menu
else
show_menu
fi
;;
4)
confirmAnswer "Are you sure you want to remove CraftBeerPi from autostart"
confirmAnswer "Are you sure you want to remove CraftBeerPi from autostart?"
if [ $? = 0 ]; then
update-rc.d -f craftbeerpiboot remove
show_menu
@@ -103,7 +103,7 @@ show_menu () {
;;
6)
sudo /etc/init.d/craftbeerpiboot stop
whiptail --title "CraftBeerPi stoped" --msgbox "The software is stoped" 8 78
whiptail --title "CraftBeerPi stopped" --msgbox "The software is stopped." 8 78
show_menu
;;
7)
@@ -126,10 +126,10 @@ show_menu () {
fi
;;
9)
confirmAnswer "Are you sure you want to delete all CraftBeerPi log files"
confirmAnswer "Are you sure you want to delete all CraftBeerPi log files?"
if [ $? = 0 ]; then
sudo rm -rf logs/*.log
whiptail --title "Log files deleted" --msgbox "All CraftBeerPi Files are deleted. You must hit OK to continue." 8 78
whiptail --title "Log files deleted" --msgbox "All CraftBeerPi files are deleted. You must hit OK to continue." 8 78
show_menu
else
show_menu


+ 15
- 15
modules/base_plugins/brew_steps/__init__.py View File

@@ -14,9 +14,9 @@ class MashStep(StepBase):
Just put the decorator @cbpi.step on top of a method
'''
# Properties
temp = Property.Number("Temperature", configurable=True, description="Target Temperature of Mash Step")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the mashing takes place")
timer = Property.Number("Timer in Minutes", configurable=True, description="Timer is started when the target temperature is reached")
temp = Property.Number("Temperature", configurable=True, description="Target temperature of mash step.")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the mashing takes place.")
timer = Property.Number("Timer in Minutes", configurable=True, description="Timer is started when the target temperature is reached.")

def init(self):
'''
@@ -67,8 +67,8 @@ class MashInStep(StepBase):
Just put the decorator @cbpi.step on top of a method
'''
# Properties
temp = Property.Number("Temperature", configurable=True, description="Target Temperature of Mash Step")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the mashing takes place")
temp = Property.Number("Temperature", configurable=True, description="Target temperature of mash step.")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the mashing takes place.")
s = False

@cbpi.action("Change Power")
@@ -95,14 +95,14 @@ class MashInStep(StepBase):
# Check if Target Temp is reached
if self.get_kettle_temp(self.kettle) >= float(self.temp) and self.s is False:
self.s = True
self.notify("Step Temp Reached!", "Please press the next button to continue", timeout=None)
self.notify("Step temperature reached!", "Please press the next button to continue.", timeout=None)



@cbpi.step
class ChilStep(StepBase):

timer = Property.Number("Timer in Minutes", configurable=True, default_value=0, description="Timer is started immediately")
timer = Property.Number("Timer in Minutes", configurable=True, default_value=0, description="Timer is started immediately.")

@cbpi.action("Stat Timer")
def start(self):
@@ -126,8 +126,8 @@ class ChilStep(StepBase):
@cbpi.step
class PumpStep(StepBase):

pump = StepProperty.Actor("Pump", description="Pump actor gets toogled")
timer = Property.Number("Timer in Minutes", configurable=True, default_value=0, description="Timer is started immediately")
pump = StepProperty.Actor("Pump", description="Pump actor gets toggled.")
timer = Property.Number("Timer in Minutes", configurable=True, default_value=0, description="Timer is started immediately.")

@cbpi.action("Stat Timer")
def start(self):
@@ -157,15 +157,15 @@ class BoilStep(StepBase):
Just put the decorator @cbpi.step on top of a method
'''
# Properties
temp = Property.Number("Temperature", configurable=True, default_value=100, description="Target temperature for boiling")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the boiling step takes place")
timer = Property.Number("Timer in Minutes", configurable=True, default_value=90, description="Timer is started when target temperature is reached")
hop_1 = Property.Number("Hop 1 Addition", configurable=True, description="Fist Hop alert")
temp = Property.Number("Temperature", configurable=True, default_value=100, description="Target temperature for boiling.")
kettle = StepProperty.Kettle("Kettle", description="Kettle in which the boiling step takes place.")
timer = Property.Number("Timer in Minutes", configurable=True, default_value=90, description="Timer is started when target temperature is reached.")
hop_1 = Property.Number("Hop 1 Addition", configurable=True, description="First hop alert.")
hop_1_added = Property.Number("",default_value=None)
hop_2 = Property.Number("Hop 2 Addition", configurable=True, description="Second Hop alert")
hop_2 = Property.Number("Hop 2 Addition", configurable=True, description="Second hop alert.")
hop_2_added = Property.Number("", default_value=None)
hop_3 = Property.Number("Hop 3 Addition", configurable=True)
hop_3_added = Property.Number("", default_value=None, description="Second Hop alert")
hop_3_added = Property.Number("", default_value=None, description="Third hop alert.")

def init(self):
'''


+ 2
- 2
modules/base_plugins/gpio_actor/__init__.py View File

@@ -18,7 +18,7 @@ except Exception as e:
@cbpi.actor
class GPIOSimple(ActorBase):

gpio = Property.Select("GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], description="GPIO to which the actor is connected")
gpio = Property.Select("GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], description="GPIO to which the actor is connected.")

def init(self):
GPIO.setup(int(self.gpio), GPIO.OUT)
@@ -35,7 +35,7 @@ class GPIOSimple(ActorBase):
@cbpi.actor
class GPIOPWM(ActorBase):

gpio = Property.Select("GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], description="GPIO to which the actor is connected")
gpio = Property.Select("GPIO", options=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27], description="GPIO to which the actor is connected.")
duty_cylce = Property.Number("Duty Cycle", configurable=True)

p = None


+ 2
- 2
modules/base_plugins/hysteresis/__init__.py View File

@@ -8,8 +8,8 @@ class Hysteresis(KettleController):

# Custom Properties

on = Property.Number("Offset On", True, 0, description="Offset below target temp when heater should switched on. Should be bigger then Offset Off")
off = Property.Number("Offset Off", True, 0, description="Offset below target temp when heater should switched off. Should be smaller then Offset Off")
on = Property.Number("Offset On", True, 0, description="Offset below target temp when heater should be switched on. Should be bigger then Offset Off")
off = Property.Number("Offset Off", True, 0, description="Offset below target temp when heater should be switched off. Should be smaller then Offset Off")

def stop(self):
'''


+ 1
- 1
modules/notification/__init__.py View File

@@ -44,7 +44,7 @@ def init(cbpi):
:return: None
"""
if cbpi.get_config_parameter("donation_notification", "YES") == "YES":
msg = {"id": len(cbpi.cache["messages"]), "type": "info", "headline": "Support CraftBeerPi with your donation", "message": "You will find the PayPay Donation button in the system menu" , "read": False}
msg = {"id": len(cbpi.cache["messages"]), "type": "info", "headline": "Support CraftBeerPi with your donation", "message": "You will find the PayPal Donation button in the system menu." , "read": False}
cbpi.cache["messages"].append(msg)

NotificationView.register(cbpi.app, route_base='/api/notification')

+ 3
- 3
modules/recipe_import/beerxml.py View File

@@ -15,7 +15,7 @@ class BeerXMLImport(FlaskView):
@route('/', methods=['GET'])
def get(self):
if not os.path.exists(self.BEER_XML_FILE):
self.api.notify(headline="File Not Found", message="Please upload a Beer.xml File",
self.api.notify(headline="File Not Found", message="Please upload a beer.xml file.",
type="danger")
return ('', 404)
result = []
@@ -36,11 +36,11 @@ class BeerXMLImport(FlaskView):
file = request.files['file']
if file and self.allowed_file(file.filename):
file.save(os.path.join(self.api.app.config['UPLOAD_FOLDER'], "beer.xml"))
self.api.notify(headline="Upload Successful", message="The Beer XML file was uploaded succesfully")
self.api.notify(headline="Upload Successful", message="The beer.xml file was succesfully uploaded.")
return ('', 204)
return ('', 404)
except Exception as e:
self.api.notify(headline="Upload Failed", message="Failed to upload Beer xml", type="danger")
self.api.notify(headline="Upload Failed", message="Failed to upload beer.xml file.", type="danger")
return ('', 500)

@route('/<int:id>', methods=['POST'])


+ 4
- 4
modules/recipe_import/kbh.py View File

@@ -17,7 +17,7 @@ class KBH(FlaskView):
conn = None
try:
if not os.path.exists(self.api.app.config['UPLOAD_FOLDER'] + '/kbh.db'):
self.api.notify(headline="File Not Found", message="Please upload a Kleiner Brauhelfer Database", type="danger")
self.api.notify(headline="File Not Found", message="Please upload a Kleiner Brauhelfer database.", type="danger")
return ('', 404)

conn = sqlite3.connect(self.api.app.config['UPLOAD_FOLDER'] + '/kbh.db')
@@ -30,7 +30,7 @@ class KBH(FlaskView):
return json.dumps(result)
except Exception as e:
print e
self.api.notify(headline="Failed to load KHB database", message="ERROR", type="danger")
self.api.notify(headline="Failed to load Kleiner Brauhelfer database.", message="ERROR", type="danger")
return ('', 500)
finally:
if conn:
@@ -47,11 +47,11 @@ class KBH(FlaskView):
if file and self.allowed_file(file.filename):
filename = secure_filename(file.filename)
file.save(os.path.join(self.api.app.config['UPLOAD_FOLDER'], "kbh.db"))
self.api.notify(headline="Upload Successful", message="The Kleiner Brauhelfer Database was uploaded succesfully")
self.api.notify(headline="Upload Successful", message="The Kleiner Brauhelfer database was succesfully uploaded.")
return ('', 204)
return ('', 404)
except Exception as e:
self.api.notify(headline="Upload Failed", message="Failed to upload Kleiner Brauhelfer", type="danger")
self.api.notify(headline="Upload Failed", message="Failed to upload Kleiner Brauhelfer database.", type="danger")

return ('', 500)



+ 1
- 1
modules/recipe_import/restapi.py View File

@@ -49,7 +49,7 @@ class RESTImport(FlaskView):
self.api.emit("UPDATE_ALL_STEPS", Step.get_all())
self.api.notify(headline="Recipe %s loaded successfully" % name, message="")
except Exception as e:
self.api.notify(headline="Failed to load Recipe", type="danger", message=str(e))
self.api.notify(headline="Failed to load recipe", type="danger", message=str(e))
m = str(e.message)
return (str(e), 500)



+ 2
- 2
modules/system/endpoints.py View File

@@ -48,7 +48,7 @@ class SystemView(FlaskView):
o.fetch()
g = Git('./')
g.checkout(name)
cbpi.notify("Checkout successful", "Please restart the system")
cbpi.notify("Checkout successful.", "Please restart the system.")
return ('', 204)
@route('/git/status', methods=['GET'])
@@ -95,7 +95,7 @@ class SystemView(FlaskView):
repo = Repo('./')
o = repo.remotes.origin
info = o.pull()
cbpi.notify("Pull successful", "The lasted updated was downloaded. Please restart the system")
cbpi.notify("Pull successful", "The lastet update was downloaded. Please restart the system.")
return ('', 204)
@route('/dump', methods=['GET'])


Loading…
Cancel
Save