-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
The three that help most, in order:
- A payload from hardware nobody here has. Every catalog was built from captured uploads, and the ones that are thin are thin because nothing was captured. See Reporting a new sensor.
- A problem, reported with what the driver printed. See Troubleshooting.
- A pull request. Everything below is about those.
Before writing one, read Conventions. It is what CI checks, and it is short.
- a test that fails without the change
-
python -m pytest tests -qpassing -
black bin tools tests install.pyrun -
mypyand the docstring checker passing - an entry in
CHANGELOG.md, in the same voice as the ones above it
- Add the raw name to the catalog. Through the generator where there is one, not by hand. See Catalogs.
- Give it a unit group if WeeWX does not know the field.
- If it belongs to a sensor family the driver does not know, add the family to
CHANNELSwith its channel count. - If another protocol already sends the same reading, send it to the same WeeWX field. A test compares the catalogs and will say so if you do not.
- Add a captured payload to
tests/fixturesand a test that says what should come out of it.
bin/user/ultimatepush/protocols/ has six worked examples. A new one is a class and a
catalog:
class MyProtocol(Protocol):
name = 'mine'
label = 'My Weather Thing'
hardware = 'the boxes this is for'
answer = 'ok' # what its firmware waits for
content_type = 'text/plain'
identity = ('serial',) # which field names the station
units = US
rain_counter = 'dayRain' # what StdWXCalculate differences, or None
fields = _catalog.FIELDS
groups = _catalog.GROUPS
@classmethod
def claims(cls, request, raw):
return 5 if 'something_only_mine_sends' in raw else 0Then add it to registry(), add a captured payload to tests/fixtures, and write a test
that says what should come out of it.
claims returns how sure the protocol is, and the surest wins. Keep the numbers honest:
5 or 6 for something only this protocol sends, 2 or 3 for something it merely cannot rule
out. A protocol that overstates itself takes uploads from one that would have read them
properly.
If the payload is not name and value pairs, override readings. WeatherFlow unpacks JSON
arrays there; Acurite and LaCrosse rename theirs to keep two sensors apart.
page.py is the whole interface: one self-contained page, no build step, no bundler, no
dependency to install. Keep it that way. admin.py beside it is the routing and the JSON
API, and that is where a new tab's data comes from.
- Installation
- Hardware
- Web interface
- Stations
- Several stations
- Hosted hardware
- Sensors this driver asks
- Database columns
- Configuration
- Diagnostics
- Troubleshooting
- Keeping strangers out
- Reporting a new sensor
- Acurite
- Davis AirLink
- Ambient
- Ecowitt
- Ecowitt gateway API
- Ambient Weather (ambientweather.net)
- Home Assistant
- Lacrosse
- PurpleAir
- rtl_433
- Weatherflow
- Wunderground