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
s2-python-0.0.1.tar.gz
(19.3 kB
view hashes)
Built Distribution
s2_python-0.0.1-py3-none-any.whl
(32.8 kB
view hashes)
Close
Hashes for s2_python-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6d08bb55871b70f8361fbe647e2eb917634dd542ccfecf97ac77aa883dcaf89 |
|
MD5 | 58783e82a7a67ba01dfe98c6b6bd9cbe |
|
BLAKE2b-256 | b043969db3c730d34f1cf202341e28e169a6e66fbaff811dc7a58521b0e4cc42 |