Merge pull request #8 from Manuel83/master

Update 9/6/17
This commit is contained in:
swimIan
2017-09-06 06:08:22 -07:00
committed by GitHub
6 changed files with 52 additions and 48 deletions
+3 -1
View File
@@ -29,7 +29,7 @@ import modules.sensors
import modules.actor
import modules.notification
import modules.fermenter
import modules.addon
from modules.addon.endpoints import initPlugins
import modules.ui
import modules.system
import modules.buzzer
@@ -37,6 +37,7 @@ import modules.stats
import modules.kettle
import modules.recipe_import
import modules.core.db_mirgrate
from app_config import cbpi
# Build the database:
# This will create the database file using SQLAlchemy
@@ -59,6 +60,7 @@ def init_db():
pass
init_db()
initPlugins()
cbpi.run_init()
cbpi.run_background_processes()
+2 -3
View File
@@ -188,9 +188,8 @@ def loadPlugins():
cbpi.notify("Failed to load plugin %s " % filename, str(e), type="danger", timeout=None)
cbpi.app.logger.error(e)
@cbpi.initalizer(order=1)
def initPlugins(app):
#@cbpi.initalizer(order=1)
def initPlugins():
loadCorePlugins()
loadPlugins()
@@ -18,6 +18,7 @@ def getSensors():
arr = []
for dirname in os.listdir('/sys/bus/w1/devices'):
if (dirname.startswith("28") or dirname.startswith("10")):
cbpi.app.logger.info("Device %s Found (Family: 28/10, Thermometer on GPIO4 (w1))" % dirname)
arr.append(dirname)
return arr
except:
+3 -3
View File
@@ -274,11 +274,11 @@ class CraftBeerPi(ActorAPI, SensorAPI):
if isinstance(tmpObj.__getattribute__(m), Property.Number):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append(
{"name": m, "label": t.label, "type": "number", "configurable": t.configurable, "description": t.description})
{"name": m, "label": t.label, "type": "number", "configurable": t.configurable, "description": t.description, "default_value": t.default_value})
elif isinstance(tmpObj.__getattribute__(m), Property.Text):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append(
{"name": m, "label": t.label, "type": "text", "configurable": t.configurable, "description": t.description})
{"name": m, "label": t.label, "type": "text", "configurable": t.configurable, "default_value": t.default_value, "description": t.description})
elif isinstance(tmpObj.__getattribute__(m), Property.Select):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append(
@@ -356,7 +356,7 @@ class CraftBeerPi(ActorAPI, SensorAPI):
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "number", "configurable": t.configurable, "default_value": t.default_value, "description": t.description})
elif isinstance(tmpObj.__getattribute__(m), StepProperty.Text):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "text", "configurable": t.configurable, "description": t.description})
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "text", "configurable": t.configurable, "default_value": t.default_value, "description": t.description})
elif isinstance(tmpObj.__getattribute__(m), StepProperty.Select):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "select", "configurable": True, "options": t.options, "description": t.description})
+2 -1
View File
@@ -22,6 +22,7 @@ class Property(object):
PropertyType.__init__(self)
self.label = label
self.configurable = configurable
self.default_value = default_value
self.description = description
class Actor(PropertyType):
@@ -64,4 +65,4 @@ class StepProperty(Property):
PropertyType.__init__(self)
self.label = label
self.configurable = True
self.description = description
self.description = description
File diff suppressed because one or more lines are too long