Comments (2)
It's a side-effect of the fact it makes sense for all the readings to be processed at once, coupled with the fact I prefer methods over attributes for getting values... and you kind of expect a method to do something and fetch the data.
There are ways this could be mitigated, but it's one of those cases where running update_sensor()
twice probably hurts less than contriving some method to prevent it.
With the benefit of hindsight, I'd probably rewrite the whole library API 😬 but since we can't really do that, I'm open to suggestions!
from bme280-python.
It's a side-effect of the fact it makes sense for all the readings to be processed at once
On that point, it did occur to me that adding a get_readings
method which returns a tuple (temperature, pressure, humidity)
would be a nice addition for those who want to get all of the values, particularly in forced mode. I could do that if you'd like.
coupled with the fact I prefer methods over attributes for getting values...
This is precisely the kind of thing that makes me spend a day agonising over how I should do something rather than actually doing it 😆 . Python's flexibility can be a blessing and a curse.
I think it would be safe to remove self.update_sensor()
from get_altitude
as it will always be called anyway on the first line of get_pressure
(and get_pressure
requires that line to function correctly).
from bme280-python.
Related Issues (18)
- test.py example is broken HOT 3
- Correct links on PyPi from https://pypi.org/project/pimoroni-bme280/ HOT 2
- ImportError: No module named bme280 when running all-values.py HOT 10
- bme280 HOT 1
- Breakout board BME280 HOT 2
- Should setup() be called on each update? HOT 1
- Unable to find bme280 on 0x76, CHIP_ID returned 58 HOT 2
- ValueError: Invalid format specifier when running allvalues.py HOT 1
- ROCK 4 C+
- Binho Nova adapter instructions
- Raspberry Pi hangs in forced mode HOT 5
- ImportError HOT 11
- Add temperature offset function HOT 2
- bug in install.sh script - closing square bracket on line 64
- install.sh error HOT 2
- Remind user to turn on I2C if using raspi HOT 2
- Syntax error in local_altitude.py example HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bme280-python.