Restore 1 decimal place to pressure values
Let the frontend round if it wants to.
This commit is contained in:
parent
b6c8bb24b3
commit
93fdbf9bd9
@ -610,9 +610,8 @@ sensor:
|
||||
name: "BME680 Pressure"
|
||||
id: bme680_pressure
|
||||
oversampling: 16x
|
||||
accuracy_decimals: 0
|
||||
accuracy_decimals: 1
|
||||
filters:
|
||||
- lambda: return (round(x));
|
||||
- offset: !lambda return id(pressure_offset);
|
||||
gas_resistance:
|
||||
name: "BME680 Gas Resistance"
|
||||
@ -652,7 +651,7 @@ sensor:
|
||||
name: "BME680 Relative Pressure"
|
||||
id: bme680_relative_pressure
|
||||
unit_of_measurement: hPa
|
||||
accuracy_decimals: 0
|
||||
accuracy_decimals: 1
|
||||
update_interval: 15s
|
||||
lambda: |-
|
||||
// Get the current absolute pressure in hPa
|
||||
@ -677,7 +676,7 @@ sensor:
|
||||
// h = height above sea level
|
||||
// R = universal gas constant (8.31432 N·m/(mol·K))
|
||||
// T = temperature in Kelvin
|
||||
float relative_pressure = round(abs_pressure * exp(9.80665 * 0.0289644 * elevation / (8.31432 * temp_kelvin)));
|
||||
float relative_pressure = abs_pressure * exp(9.80665 * 0.0289644 * elevation / (8.31432 * temp_kelvin));
|
||||
|
||||
return relative_pressure;
|
||||
|
||||
@ -932,9 +931,9 @@ number:
|
||||
- platform: template
|
||||
name: "BME680 Pressure Offset"
|
||||
id: pressure_offset_setter
|
||||
min_value: -25
|
||||
max_value: 25
|
||||
step: 1
|
||||
min_value: -10
|
||||
max_value: 10
|
||||
step: 0.1
|
||||
lambda: |-
|
||||
return id(pressure_offset);
|
||||
set_action:
|
||||
|
Loading…
x
Reference in New Issue
Block a user