Files
brewLogger/source/loader.py

13 lines
370 B
Python

import yaml
from brewSensor import BME680Sensor, DHT11Sensor
from brewRelay import BrewRelay
def load(filePath):
loader = yaml.SafeLoader
loader.add_constructor('!Relay', BrewRelay.fromYaml)
loader.add_constructor('!bme680', BME680Sensor.fromYaml)
loader.add_constructor('!dht11', DHT11Sensor.fromYaml)
return yaml.load(open(filePath, "rb"), Loader=loader)