mirror of
https://github.com/cmur2/python-bme680.git
synced 2024-12-22 22:54:29 +01:00
Use standard units for pressure measures, let user choose conversion
This commit is contained in:
parent
e97c5f9241
commit
405867a4aa
@ -57,7 +57,7 @@ try:
|
|||||||
if sensor.get_sensor_data():
|
if sensor.get_sensor_data():
|
||||||
output = '{0:.2f} C,{1:.2f} hPa,{2:.2f} %RH'.format(
|
output = '{0:.2f} C,{1:.2f} hPa,{2:.2f} %RH'.format(
|
||||||
sensor.data.temperature,
|
sensor.data.temperature,
|
||||||
sensor.data.pressure,
|
sensor.data.pressure / 100.0,
|
||||||
sensor.data.humidity)
|
sensor.data.humidity)
|
||||||
|
|
||||||
if sensor.data.heat_stable:
|
if sensor.data.heat_stable:
|
||||||
|
@ -24,7 +24,7 @@ def display_data(offset=0):
|
|||||||
sensor.get_sensor_data()
|
sensor.get_sensor_data()
|
||||||
output = '{0:.2f} C, {1:.2f} hPa, {2:.3f} %RH'.format(
|
output = '{0:.2f} C, {1:.2f} hPa, {2:.3f} %RH'.format(
|
||||||
sensor.data.temperature,
|
sensor.data.temperature,
|
||||||
sensor.data.pressure,
|
sensor.data.pressure / 100.0,
|
||||||
sensor.data.humidity)
|
sensor.data.humidity)
|
||||||
print(output)
|
print(output)
|
||||||
print('')
|
print('')
|
||||||
|
@ -31,7 +31,7 @@ try:
|
|||||||
|
|
||||||
output = '{0:.2f} C,{1:.2f} hPa,{2:.3f} %RH'.format(
|
output = '{0:.2f} C,{1:.2f} hPa,{2:.3f} %RH'.format(
|
||||||
sensor.data.temperature,
|
sensor.data.temperature,
|
||||||
sensor.data.pressure,
|
sensor.data.pressure / 100.0,
|
||||||
sensor.data.humidity)
|
sensor.data.humidity)
|
||||||
|
|
||||||
print(output)
|
print(output)
|
||||||
|
@ -291,7 +291,7 @@ class BME680(BME680Data):
|
|||||||
self.data.temperature = temperature / 100.0
|
self.data.temperature = temperature / 100.0
|
||||||
self.ambient_temperature = temperature # Saved for heater calc
|
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.humidity = self._calc_humidity(adc_hum) / 1000.0
|
||||||
self.data.gas_resistance = self._calc_gas_resistance(adc_gas_res, gas_range)
|
self.data.gas_resistance = self._calc_gas_resistance(adc_gas_res, gas_range)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user