Corrected sensor name BCM600 --> BME680

This commit is contained in:
2021-10-03 19:34:46 +02:00
parent 7bdbf0b4dc
commit 0754cef450
3 changed files with 6 additions and 6 deletions

View File

@@ -11,7 +11,7 @@ relays:
pin: 24
sensors:
- !bcm600
- !bme680
location: inside
interval: 2

View File

@@ -4,7 +4,7 @@ import yaml
from flask import Flask, request, render_template, send_file, redirect, send_from_directory
import source # take a look in source/__init__.py
from brewSensor import BCM600Sensor, DHT11Sensor, BrewSensor
from brewSensor import BME680Sensor, DHT11Sensor, BrewSensor
from brewCamera import BrewCamera
from brewRelay import BrewRelay
@@ -14,7 +14,7 @@ brewCamera = BrewCamera(20)
def readYaml(filePath):
loader = yaml.SafeLoader
loader.add_constructor('!Relay', BrewRelay.fromYaml)
loader.add_constructor('!bcm600', BCM600Sensor.fromYaml)
loader.add_constructor('!bme680', BME680Sensor.fromYaml)
loader.add_constructor('!dht11', DHT11Sensor.fromYaml)
return yaml.load(open(filePath, "rb"), Loader=loader)

View File

@@ -75,7 +75,7 @@ class DHT11Sensor(BrewSensor):
def fromYaml(loader, node):
return DHT11Sensor(**loader.construct_mapping(node))
class BCM600Sensor(BrewSensor):
class BME680Sensor(BrewSensor):
def __init__(self, location, interval):
super().__init__(location, interval)
@@ -176,7 +176,7 @@ class BCM600Sensor(BrewSensor):
@staticmethod
def fromYaml(loader, node):
return BCM600Sensor(**loader.construct_mapping(node))
return BME680Sensor(**loader.construct_mapping(node))
def __repr__(self):
return "{0:.2f} C,{1:.2f} hPa,{2:.2f} %RH".format(self.temp, self.pressure, self.humidity)
@@ -184,7 +184,7 @@ class BCM600Sensor(BrewSensor):
if __name__ == '__main__':
# brewSensor = DHT11Sensor(13, 'outside', 30)
brewSensor = BCM600Sensor('inside', 2)
brewSensor = BME680Sensor('inside', 2)
while True:
print(brewSensor.temp)