S2 Protocol Python Wrapper
Project description
This Python package implements the message validation for the EN50491-12-2 “S2” standard for home and building energy management. This implementation is based on the asyncapi description of the protocol provided in the s2-ws-json repository.
Currently, the package supports the common and FILL RATE BASED CONTROL types and messages.
Example
# create s2 messages as Python objects
number_range = PowerRange(start_of_range=4.0, end_of_range=5.0, commodity_quantity=CommodityQuantity.ELECTRIC_POWER_L1)
# serialize s2 messages
number_range.to_json()
# deserialize s2 messages
json_str = '{"start_of_range": 4.0, "end_of_range": 5.0, "commodity_quantity": "ELECTRIC.POWER.L1"}'
PowerRange.from_json(json_str)
Development
For development, you can install the required dependencies using the following command:
pip install -e .[testing,development]
The tests can be run using tox:
tox
To build the package, you can use tox as well:
tox -e build,clean
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file s2-python-0.0.1.tar.gz
.
File metadata
- Download URL: s2-python-0.0.1.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca088aa594d10b9e1c482127109b807626defc32c5567323fe1a56cdd6298dd1 |
|
MD5 | e9b42e772df4cc16d8f33d727695f4e1 |
|
BLAKE2b-256 | 495536b033cc67a2996c8838adaa1d269c02e8d9cb1aa916da3c99ed51f669e1 |
File details
Details for the file s2_python-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: s2_python-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6d08bb55871b70f8361fbe647e2eb917634dd542ccfecf97ac77aa883dcaf89 |
|
MD5 | 58783e82a7a67ba01dfe98c6b6bd9cbe |
|
BLAKE2b-256 | b043969db3c730d34f1cf202341e28e169a6e66fbaff811dc7a58521b0e4cc42 |