added ir server, squeeze server, ...
This commit is contained in:
Binary file not shown.
@@ -25,6 +25,9 @@ class Filter:
|
||||
return abs(val - self.mean()) < self.max_mean_deviation
|
||||
|
||||
def add_if_valid(self, val):
|
||||
if val is None:
|
||||
return False
|
||||
|
||||
if self.is_valid_value(val):
|
||||
self.values.append(val)
|
||||
if len(self.values) > self._length:
|
||||
@@ -66,16 +69,9 @@ def send_to_home_assistant(temperature, humidity):
|
||||
requests.post(humidity_url, json=humidity_data, headers=headers)
|
||||
|
||||
|
||||
last_values = []
|
||||
|
||||
|
||||
def filter(value):
|
||||
last_values.append(value)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
temp_filter = Filter(10, 5)
|
||||
humidity_filter = Filter(10, 5)
|
||||
temp_filter = Filter(2, 5)
|
||||
humidity_filter = Filter(3, 5)
|
||||
|
||||
while True:
|
||||
sensor = Adafruit_DHT.DHT22
|
||||
|
||||
Reference in New Issue
Block a user