Commit 27856572 authored by Piotr "PHT" Jasiek's avatar Piotr "PHT" Jasiek

Addition of BMP280 service

parent 9564a520
......@@ -7,9 +7,10 @@ import time
import datetime
from modules.pcsensors import *
from modules.database import *
from modules.bmp280 import *
####Constant
sensor = BME280(t_mode=BME280_OSAMPLE_8, p_mode=BME280_OSAMPLE_8, h_mode=BME280_OSAMPLE_8)
###Requesting time
......@@ -21,6 +22,9 @@ laptop_ram = get_memory_percent()
laptop_hdd = get_disk_percent('/')
laptop_fan_rpm = get_fan_rpm()
laptop_cpu_temp = get_cpu_temp()
laptop_outside_temp = round(sensor.read_temperature(), 2)
laptop_outside_humidity = round(sensor.read_humidity(), 2)
laptop_outside_pressure = round(sensor.read_pressure()/100, 2)
##Upload sensor reading
......@@ -30,6 +34,9 @@ try:
add_record(request_time, 'laptop_hdd', laptop_hdd)
add_record(request_time, 'laptop_fan_rpm', laptop_fan_rpm)
add_record(request_time, 'laptop_cpu_temp', laptop_cpu_temp)
add_record(request_time, 'laptop_outside_temp', laptop_outside_temp)
add_record(request_time, 'laptop_outside_humidity', laptop_outside_temp)
add_recotd(request_time, 'laptop_outside_pressure', laptop_outside_pressure)
except:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment