Skip to main content

BME280 Driver for CircuitPython used for testing functionality with no hardware attached

Project description

Introduction

Discord Build Status Code Style: Black

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

circuitpython_fake_bme280-1.1.tar.gz (26.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

circuitpython_fake_bme280-1.1-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file circuitpython_fake_bme280-1.1.tar.gz.

File metadata

  • Download URL: circuitpython_fake_bme280-1.1.tar.gz
  • Upload date:
  • Size: 26.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for circuitpython_fake_bme280-1.1.tar.gz
Algorithm Hash digest
SHA256 0e76e2fa947bc84f61cce174565ba601fb9258686067a19f9958011f37f203e2
MD5 48b80620622ee0824a8fa5d34d69ca1a
BLAKE2b-256 a0fb7d1297595398daaec99094cfaa3b44d2b568fdee1d3cb121a8145267d426

See more details on using hashes here.

File details

Details for the file circuitpython_fake_bme280-1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for circuitpython_fake_bme280-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a448581bc29ffe86ef51878f1e414530a41fa0cce4215c26858b4b7be32ed0d
MD5 b0f79697026544a267e3fa050dda3984
BLAKE2b-256 7a83af1958e2e535de09ee8b5759fd579e4f9fb887ff240a2c33c345f1196a0f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page