Kaynağa Gözat

Merge pull request #8 from Manuel83/master

Update 9/6/17
pull/105/head
swimIan GitHub 8 yıl önce
ebeveyn
işleme
14e4e6d61a
6 değiştirilmiş dosya ile 52 ekleme ve 48 silme
  1. +3
    -1
      modules/__init__.py
  2. +2
    -3
      modules/addon/endpoints.py
  3. +1
    -0
      modules/base_plugins/one_wire/__init__.py
  4. +3
    -3
      modules/core/core.py
  5. +2
    -1
      modules/core/props.py
  6. +41
    -40
      modules/ui/static/bundle.js

+ 3
- 1
modules/__init__.py Dosyayı Görüntüle

@@ -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()


+ 2
- 3
modules/addon/endpoints.py Dosyayı Görüntüle

@@ -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)
def initPlugins(app):

#@cbpi.initalizer(order=1)
def initPlugins():
loadCorePlugins() loadCorePlugins()
loadPlugins() loadPlugins()




+ 1
- 0
modules/base_plugins/one_wire/__init__.py Dosyayı Görüntüle

@@ -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:


+ 3
- 3
modules/core/core.py Dosyayı Görüntüle

@@ -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})


+ 2
- 1
modules/core/props.py Dosyayı Görüntüle

@@ -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):
@@ -64,4 +65,4 @@ class StepProperty(Property):
PropertyType.__init__(self) PropertyType.__init__(self)
self.label = label self.label = label
self.configurable = True self.configurable = True
self.description = description
self.description = description

+ 41
- 40
modules/ui/static/bundle.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


Yükleniyor…
İptal
Kaydet