You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+17-31Lines changed: 17 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,16 +18,20 @@ Introduction
18
18
:target:https://github.com/psf/black
19
19
:alt:Code Style: Black
20
20
21
-
BME280 Driver for CircuitPython used for testing functionality with no hardware attached
21
+
**This code is for testing purposes only! If you are looking for a Bosch BME280 driver, please use the [Adafruit_CircuitPython_BME280 library](https://github.com/adafruit/Adafruit_CircuitPython_BME280)**.
22
22
23
+
This driver mocks the functionality of the [Adafruit_CircuitPython_BME280 library](https://github.com/adafruit/Adafruit_CircuitPython_BME280/), allowing you to test your code without
24
+
attaching physical hardware.
25
+
26
+
Instead of using random data, weather data is instead pulled from [the free OpenWeatherMaps API](https://openweathermap.org)
27
+
and returned as if it were coming from the BME280 sensor properties. A free OpenWeatherMaps API key is **required** to use this library (see the Usage section below for more information).
Make sure that you have ``circup`` installed in your Python environment.
72
-
Install it with the following command if necessary:
73
-
74
-
.. code-block:: shell
75
-
76
-
pip3 install circup
77
-
78
-
With ``circup`` installed and your CircuitPython device connected use the
79
-
following command to install:
80
-
81
-
.. code-block:: shell
82
-
83
-
circup install fake_bme280
84
-
85
-
Or the following command to update an existing version:
68
+
Usage Example
69
+
=============
86
70
87
-
.. code-block:: shell
71
+
To obtain an OpenWeatherMaps API key, sign up for a free account at [OpenWeatherMaps](https://openweathermap.org) and [generate an API key](https://home.openweathermap.org/api_keys). Then, in the root of this
72
+
project, add a file called `settings.toml` with the following information:
88
73
89
-
circup update
74
+
.. code-block:: toml
75
+
openweather_token = "my_api_key"
76
+
openweather_location = "New York, US"
77
+
openweather_units = "metric"
90
78
91
-
Usage Example
92
-
=============
79
+
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`).
93
80
94
-
.. todo:: Add a quick, simple example. It and other examples should live in the
95
-
examples folder and be included in docs/examples.rst.
81
+
Then, run the code within examples/fake_bme280.py to use the "fake" BME280 sensor.
0 commit comments