Skip to content

Commit dea41bd

Browse files
committed
Update the README
1 parent 62ec319 commit dea41bd

File tree

1 file changed

+37
-3
lines changed

1 file changed

+37
-3
lines changed

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,33 @@ An advanced thermostat for micropython devices using `asyncio`.
44

55
## Installation
66

7-
On a micropython device, install with `mip`:
7+
On a micropython device, install with `mip` from the REPL:
8+
9+
```python
10+
>>> import mip
11+
>>> mip.install("github:solanus-systems/micropython-thermostat")
12+
```
13+
14+
Or on a unix build of micropython via the CLI:
815

916
```bash
10-
mip install github:solanus-systems/micropython-thermostat
17+
micropython -m mip install github:solanus-systems/micropython-thermostat
1118
```
1219

1320
## Usage
1421

22+
This module implements async thermostat logic but does not include any hardware-specific code.
23+
24+
Setup generally involves:
25+
26+
1. Initialize a `Thermostat` instance and set the mode and setpoint(s)
27+
1. Write a polling loop or other function to read temperature from a sensor
28+
1. Call `set_temp()` to update with the temperature read from the sensor
29+
1. Check or `await` the `heating` and `cooling` flags (`asyncio.Event` objects)
30+
1. Use the flags to control relays or other hardware as needed
31+
32+
### Example
33+
1534
```python
1635
from thermostat import Thermostat
1736

@@ -31,7 +50,7 @@ therm.set_temp(read_sensor_temp())
3150
assert therm.heating.is_set()
3251
```
3352

34-
See `thermostat.py` for the full API.
53+
See `thermostat/__init__.py` for the full API.
3554

3655
## Developing
3756

@@ -60,3 +79,18 @@ Then, you can run the tests using the micropython version of `unittest`:
6079
```bash
6180
micropython -m unittest
6281
```
82+
83+
## Releasing
84+
85+
To release a new version, first cross-compile to micropython bytecode. You need `mpy-cross` in your `PATH`:
86+
87+
```bash
88+
mpy-cross thermostat/__init__.py
89+
```
90+
91+
Then, update the versions in `manifest.py` and `package.json`. Commit your changes and make a pull request. After merging, create a new tag and push to GitHub:
92+
93+
```bash
94+
git tag vX.Y.Z
95+
git push --tags
96+
```

0 commit comments

Comments
 (0)