KnutConfig¶
-
class
knut.core.KnutConfig(file: str = '/etc/knutserver.yml')¶ Knut configuration.
Load the configuration from a file.
The
configdictionary is filled from the configuration file. The Knut objects in the YAML file with the tag!knutobjectare initialize, too. If no file is found, afailsafe()configuration is loaded.To load a Knut object from the configuration, it must be configured as following:
!knutobject module: module class: Class attribute: value ...
The keys
moduleandclassare mandatory and specify the Class and the module containing it to load. The following keys are the arguments of the classes__init__()method. For example, theknut.server.tcpserver.KnutTCPServerwould be configured as following:!knutobject module: knut.server.tcpserver class: KnutTCPServer address: 127.0.0.1 port: 8080
For details about the content of the configuration file, see Configuration.
-
config= {'lights': [], 'local': None, 'server': None, 'task': None, 'temperature': []}¶ The configuration dictionary.
-