Juan Pablo Giménez преди 5 години
родител
ревизия
79520bda7a
променени са 1 файла, в които са добавени 12 реда и са изтрити 12 реда
  1. +12
    -12
      modules/core/core.py

+ 12
- 12
modules/core/core.py Целия файл

@@ -83,7 +83,7 @@ class SensorAPI(object):
def init_sensors(self):
'''
Initialize all sensors
:return:
:return:
'''

self.app.logger.info("Init Sensors")
@@ -108,15 +108,15 @@ class SensorAPI(object):
def init_sensor(self, id):
'''
initialize sensor by id
:param id:
:return:
:param id:
:return:
'''

def start_active_sensor(instance):
'''
start active sensors as background job
:param instance:
:return:
:param instance:
:return:
'''
instance.execute()

@@ -447,12 +447,12 @@ class CraftBeerPi(ActorAPI, SensorAPI):
def run_init(self):
'''
call all initialziers after startup
:return:
:return:
'''
self.app.logger.info("Invoke Init")
self.cache["init"] = sorted(self.cache["init"], key=lambda k: k['order'])
for i in self.cache.get("init"):
self.app.logger.info("INITIALIZER - METHOD %s PAHT %s: " % (i.get("function").__name__, str(inspect.getmodule(i.get("function")).__file__) ))
self.app.logger.info("INITIALIZER - METHOD %s PATH %s: " % (i.get("function").__name__, str(inspect.getmodule(i.get("function")).__file__) ))
i.get("function")(self)


@@ -461,10 +461,10 @@ class CraftBeerPi(ActorAPI, SensorAPI):

'''
Background Task Decorator
:param key:
:param interval:
:param config_parameter:
:return:
:param key:
:param interval:
:param config_parameter:
:return:
'''
def real_decorator(function):
self.cache["background"].append({"function": function, "key": key, "interval": interval, "config_parameter": config_parameter})
@@ -476,7 +476,7 @@ class CraftBeerPi(ActorAPI, SensorAPI):
def run_background_processes(self):
'''
call all background task after startup
:return:
:return:
'''
self.app.logger.info("Start Background")



Loading…
Отказ
Запис