Skip to content

Commit

Permalink
Fix radon and pressure
Browse files Browse the repository at this point in the history
  • Loading branch information
LaStrada committed Feb 1, 2024
1 parent 9ada35a commit fb187c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions airthings_ble/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,19 +538,19 @@ async def _get_service_characteristics(
sensors.update(sensor_data)

# manage radon values
if d := sensor_data.get("radon_1day_avg") is not None:
if (d := sensor_data.get("radon_1day_avg")) is not None:
sensors["radon_1day_level"] = get_radon_level(float(d))
if not self.is_metric:
sensors["radon_1day_avg"] = float(d) * BQ_TO_PCI_MULTIPLIER
if d := sensor_data.get("radon_longterm_avg") is not None:
if (d := sensor_data.get("radon_longterm_avg")) is not None:
sensors["radon_longterm_level"] = get_radon_level(float(d))
if not self.is_metric:
sensors["radon_longterm_avg"] = (
float(d) * BQ_TO_PCI_MULTIPLIER
)

# rel to abs pressure
if pressure := sensor_data.get("rel_atm_pressure") is not None:
if (pressure := sensor_data.get("rel_atm_pressure")) is not None:
sensors["pressure"] = (
get_absolute_pressure(self.elevation, float(pressure))
if self.elevation is not None
Expand Down

0 comments on commit fb187c6

Please sign in to comment.