mirror of
https://github.com/Manuel83/craftbeerpi3
synced 2026-08-09 18:52:40 +02:00
- Import KBH
- Import BeerXML - Import REST API - Migration DB - Set Default Screen after Start - Cleanup
This commit is contained in:
@@ -13,26 +13,26 @@ class SensorView(BaseView):
|
||||
cache_key = "sensors"
|
||||
|
||||
|
||||
def post_post_callback(self, m):
|
||||
def _post_post_callback(self, m):
|
||||
cbpi.init_sensor(m.id)
|
||||
|
||||
def post_put_callback(self, m):
|
||||
def _post_put_callback(self, m):
|
||||
cbpi.stop_sensor(m.id)
|
||||
cbpi.init_sensor(m.id)
|
||||
|
||||
def pre_delete_callback(self, m):
|
||||
def _pre_delete_callback(self, m):
|
||||
cbpi.stop_sensor(m.id)
|
||||
|
||||
@cbpi.initalizer(order=1000)
|
||||
def init(cbpi):
|
||||
print "INITIALIZE SENSOR MODULE"
|
||||
|
||||
SensorView.register(cbpi.app, route_base='/api/sensor')
|
||||
SensorView.init_cache()
|
||||
cbpi.init_sensors()
|
||||
|
||||
|
||||
@cbpi.backgroundtask(key="read_passiv_sensor", interval=5)
|
||||
def read_passive_sensor():
|
||||
def read_passive_sensor(api):
|
||||
"""
|
||||
background process that reads all passive sensors in interval of 1 second
|
||||
:return: None
|
||||
|
||||
Reference in New Issue
Block a user