mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-11-03 20:53:54 +01:00
+3
-1
@@ -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()
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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})
|
||||
|
||||
@@ -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):
|
||||
|
||||
+41
-40
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user