Skip to content

Commit

Permalink
fix: handle optional signal_strength in PriDatabase.write_status
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasberbuer committed Jul 29, 2024
1 parent 77f02c4 commit aea1466
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vallenae/io/pridb.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,11 @@ def write_status(self, status: StatusRecord):
else None
),
"Eny": int(status.energy / parameter["ADC_TE"]),
"SS": int(status.signal_strength / parameter["ADC_SS"]),
"SS": (
int(status.signal_strength / parameter["ADC_SS"])
if status.signal_strength and "ADC_SS" in parameter
else None
),
"RMS": int(status.rms * 1e6 / parameter["ADC_µV"] / 0.0065536),
},
)
Expand Down

0 comments on commit aea1466

Please sign in to comment.