Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MCU680 obs.pres typo #16

Closed
avaldebe opened this issue Oct 20, 2020 · 0 comments
Closed

MCU680 obs.pres typo #16

avaldebe opened this issue Oct 20, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@avaldebe
Copy link
Owner

the data pressure field is called pres, not press

pres: float = field(metadata=base.metadata("atmospheric pressure", "hPa", "pressure"))

__post_init__ should update pres, but instead it creates an attribute press

self.press = (int(self.pres) << 8 | self.IAQ_acc) / 100

__format__ uses press instead of pres, which hides the error

if spec == "atm":
return f"{self.date:%F %T}: Temp. {self.temp:.1f} °C, Rel.Hum. {self.rhum:.1f} %, Press {self.press:.2f} hPa"
if spec == "bme":
return f"{self.date:%F %T}: Temp. {self.temp:.1f} °C, Rel.Hum. {self.rhum:.1f} %, Press {self.press:.2f} hPa, {self.gas:.1f} kΩ"
if spec == "bsec":
return f"{self.date:%F %T}: Temp. {self.temp:.1f} °C, Rel.Hum. {self.rhum:.1f} %, Press {self.press:.2f} hPa, {self.IAQ} IAQ"
if spec == "csv":
return f"{self.time}, {self.temp:.1f}, {self.rhum:.1f}, {self.press:.2f}, {self.IAQ_acc}, {self.IAQ}, {self.gas:.1f}, {self.alt}"

@avaldebe avaldebe added the bug Something isn't working label Oct 20, 2020
@avaldebe avaldebe self-assigned this Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant