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.actor
|
||||||
import modules.notification
|
import modules.notification
|
||||||
import modules.fermenter
|
import modules.fermenter
|
||||||
import modules.addon
|
from modules.addon.endpoints import initPlugins
|
||||||
import modules.ui
|
import modules.ui
|
||||||
import modules.system
|
import modules.system
|
||||||
import modules.buzzer
|
import modules.buzzer
|
||||||
@@ -37,6 +37,7 @@ import modules.stats
|
|||||||
import modules.kettle
|
import modules.kettle
|
||||||
import modules.recipe_import
|
import modules.recipe_import
|
||||||
import modules.core.db_mirgrate
|
import modules.core.db_mirgrate
|
||||||
|
|
||||||
from app_config import cbpi
|
from app_config import cbpi
|
||||||
# Build the database:
|
# Build the database:
|
||||||
# This will create the database file using SQLAlchemy
|
# This will create the database file using SQLAlchemy
|
||||||
@@ -59,6 +60,7 @@ def init_db():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
init_db()
|
init_db()
|
||||||
|
initPlugins()
|
||||||
cbpi.run_init()
|
cbpi.run_init()
|
||||||
|
|
||||||
cbpi.run_background_processes()
|
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.notify("Failed to load plugin %s " % filename, str(e), type="danger", timeout=None)
|
||||||
cbpi.app.logger.error(e)
|
cbpi.app.logger.error(e)
|
||||||
|
|
||||||
@cbpi.initalizer(order=1)
|
#@cbpi.initalizer(order=1)
|
||||||
def initPlugins(app):
|
def initPlugins():
|
||||||
|
|
||||||
loadCorePlugins()
|
loadCorePlugins()
|
||||||
loadPlugins()
|
loadPlugins()
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ def getSensors():
|
|||||||
arr = []
|
arr = []
|
||||||
for dirname in os.listdir('/sys/bus/w1/devices'):
|
for dirname in os.listdir('/sys/bus/w1/devices'):
|
||||||
if (dirname.startswith("28") or dirname.startswith("10")):
|
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)
|
arr.append(dirname)
|
||||||
return arr
|
return arr
|
||||||
except:
|
except:
|
||||||
|
|||||||
@@ -274,11 +274,11 @@ class CraftBeerPi(ActorAPI, SensorAPI):
|
|||||||
if isinstance(tmpObj.__getattribute__(m), Property.Number):
|
if isinstance(tmpObj.__getattribute__(m), Property.Number):
|
||||||
t = tmpObj.__getattribute__(m)
|
t = tmpObj.__getattribute__(m)
|
||||||
self.cache[key][name]["properties"].append(
|
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):
|
elif isinstance(tmpObj.__getattribute__(m), Property.Text):
|
||||||
t = tmpObj.__getattribute__(m)
|
t = tmpObj.__getattribute__(m)
|
||||||
self.cache[key][name]["properties"].append(
|
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):
|
elif isinstance(tmpObj.__getattribute__(m), Property.Select):
|
||||||
t = tmpObj.__getattribute__(m)
|
t = tmpObj.__getattribute__(m)
|
||||||
self.cache[key][name]["properties"].append(
|
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})
|
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):
|
elif isinstance(tmpObj.__getattribute__(m), StepProperty.Text):
|
||||||
t = tmpObj.__getattribute__(m)
|
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):
|
elif isinstance(tmpObj.__getattribute__(m), StepProperty.Select):
|
||||||
t = tmpObj.__getattribute__(m)
|
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})
|
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)
|
PropertyType.__init__(self)
|
||||||
self.label = label
|
self.label = label
|
||||||
self.configurable = configurable
|
self.configurable = configurable
|
||||||
|
self.default_value = default_value
|
||||||
self.description = description
|
self.description = description
|
||||||
|
|
||||||
class Actor(PropertyType):
|
class Actor(PropertyType):
|
||||||
|
|||||||
+41
-40
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user