Introduction
This code is for testing purposes only! If you are looking for a Bosch BME280 driver, please use the Adafruit_CircuitPython_BME280.
This driver mocks the functionality of the Adafruit_CircuitPython_BME280, allowing you to test your code without attaching physical hardware.
Instead of using random data, weather data is instead pulled from the OpenWeatherMaps API and returned as if it were coming from the BME280 sensor properties. A free OpenWeatherMap API key is required to use this library (see the Usage section below for more information).
Dependencies
This driver depends on:
Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle or individual libraries can be installed using circup.
Installing from PyPI
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:
pip3 install circuitpython-fake-bme280
To install system-wide (this may be required in some cases):
sudo pip3 install circuitpython-fake-bme280
To install in a virtual environment in your current project:
mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install circuitpython-fake-bme280
Usage Example
To obtain an OpenWeatherMaps API key, sign up for a free account at OpenWeatherMaps and generate an API key. Then, in the root of this project, add a file called “settings.toml” with the following information:
openweather_token = “my_api_key” openweather_location = “New York, US” openweather_units = “metric”
Where openweather_token is your OpenWeatherMaps API key, openweather_location is the location you want to pull weather data from, and openweather_units is the units you want the temperature to be returned in (either “metric” or “imperial”).
Then, run the code within “examples/fake_bme280.py” to use the “fake” BME280 sensor.
Documentation
API documentation for this library can be found on Read the Docs.
For information on building library documentation, please check out this guide.
Contributing
Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.
Metadata
Release files for circuitpython-fake-bme280 1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| circuitpython_fake_bme280-1.2.tar.gz | 28.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| circuitpython_fake_bme280-1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.3 kB
Release files / circuitpython_fake_bme280-1.2.tar.gz
| Download URL | circuitpython_fake_bme280-1.2.tar.gz |
|---|---|
| Size | 28.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
093c7b70a5db09b92766bae96ac58912262bdde4f9d6962dc305a5d25de3998e
|
|
BLAKE2b-256 checksum How to use checksums |
fad797a4c0e2194c52e633b5207f2a74658585c1e88a9d1f0d8dbcd42be402d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|
Release files / circuitpython_fake_bme280-1.2-py3-none-any.whl
| Download URL | circuitpython_fake_bme280-1.2-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bc464018cb78c75b1b62d043d259d8b279af2cb460efe61486d04b76070acb00
|
|
BLAKE2b-256 checksum How to use checksums |
19d769750faded8e3506de41fd89d44943efd93e0bc38f93c7a5e90ecba6478c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.15
|