MAjor update
This commit is contained in:
44
content/configuration/_index.md
Normal file
44
content/configuration/_index.md
Normal file
@@ -0,0 +1,44 @@
|
||||
+++
|
||||
title = "Configuration"
|
||||
date = "2017-04-29T18:36:24+02:00"
|
||||
Weight=3
|
||||
+++
|
||||
The config file is located at `~/.haasp/haasp_config.py`
|
||||
|
||||
### Template
|
||||
|
||||
```
|
||||
from haasp import EventObject, ConfigObject
|
||||
|
||||
class Config(ConfigObject):
|
||||
|
||||
|
||||
def config(self):
|
||||
|
||||
config = {}
|
||||
|
||||
# Clock
|
||||
config["clock"] = {}
|
||||
config["clock"]["location"] = "copenhagen"
|
||||
|
||||
return config
|
||||
|
||||
|
||||
def setup(self):
|
||||
# -------------------------------------------------------------------------
|
||||
# Create event objects
|
||||
# -------------------------------------------------------------------------
|
||||
self.clock = EventObject("clock", "now")
|
||||
self.timer_test = EventObject("timer", "test")
|
||||
|
||||
|
||||
def process_event(self):
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Create workflows
|
||||
# -------------------------------------------------------------------------
|
||||
if self.timer_test.event == "triggered":
|
||||
self.log.debug("Timer DONE!")
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user