1
0
mirror of https://github.com/cmur2/python-bme680.git synced 2024-12-22 12:54:29 +01:00

Use standard units for pressure measures, let user choose conversion

This commit is contained in:
cn 2018-12-07 11:26:50 +01:00 committed by Christian Nicolai
parent e97c5f9241
commit 405867a4aa
4 changed files with 4 additions and 4 deletions

View File

@ -57,7 +57,7 @@ try:
if sensor.get_sensor_data():
output = '{0:.2f} C,{1:.2f} hPa,{2:.2f} %RH'.format(
sensor.data.temperature,
sensor.data.pressure,
sensor.data.pressure / 100.0,
sensor.data.humidity)
if sensor.data.heat_stable:

View File

@ -24,7 +24,7 @@ def display_data(offset=0):
sensor.get_sensor_data()
output = '{0:.2f} C, {1:.2f} hPa, {2:.3f} %RH'.format(
sensor.data.temperature,
sensor.data.pressure,
sensor.data.pressure / 100.0,
sensor.data.humidity)
print(output)
print('')

View File

@ -31,7 +31,7 @@ try:
output = '{0:.2f} C,{1:.2f} hPa,{2:.3f} %RH'.format(
sensor.data.temperature,
sensor.data.pressure,
sensor.data.pressure / 100.0,
sensor.data.humidity)
print(output)

View File

@ -291,7 +291,7 @@ class BME680(BME680Data):
self.data.temperature = temperature / 100.0
self.ambient_temperature = temperature # Saved for heater calc
self.data.pressure = self._calc_pressure(adc_pres) / 100.0
self.data.pressure = self._calc_pressure(adc_pres)
self.data.humidity = self._calc_humidity(adc_hum) / 1000.0
self.data.gas_resistance = self._calc_gas_resistance(adc_gas_res, gas_range)
return True