org.openheating.Main

Description

Polls other components in given time intervals (default 5 seconds).

Sample Configuration File

Note that the configuration for the main component specifies the layout of the entire plant. Other programs, such as /bin/openheating-runplant.py or /bin/openheating-systemd-generator.py.in read that file as well because those are responsible for starting the components.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# -*- python -*-

from openheating.plant.service_def import ThermometerService
from openheating.plant.service_def import SwitchService
from openheating.plant.service_def import CircuitService
from openheating.plant.service_def import ErrorService
from openheating.plant.service_def import CrashTestDummyService

from openheating.plant import locations

ADD_SERVICE(ThermometerService(
    config = locations.confdir + '/thermometers.pyconf'))
ADD_SERVICE(SwitchService(
    config = locations.confdir + '/switches.pyconf'))
ADD_SERVICE(CircuitService(
    config = locations.confdir + '/circuits.pyconf'))
ADD_SERVICE(ErrorService())

# testing service crashes

# ADD_SERVICE(CrashTestDummyService(
#     # no_busname=True,
#     crash_in_operation_after_nsecs=3,
# ))