Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Python Wheel

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
build-wheel:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build wheel setuptools

- name: Build wheel
run: |
python -m build

- name: Upload wheel artifact
uses: actions/upload-artifact@v4
with:
name: wheel
path: dist/*.whl
3 changes: 2 additions & 1 deletion meterbus/telegram_variable_data_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def interpreted(self):
'unit': unit,
'type': str(typ),
'storage_number': storage_number,
'function': str(self.dib.function_type)
'function': str(self.dib.function_type),
'raw_vib': self.vib.parts
}

if unit_enh is not None:
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = "Python implementation of the Meter-Bus protocol"
authors = [
{ name = "Mikael Ganehag Brorsson", email = "mikael.brorsson@gmail.com" }
]
license = { text = "BSD-3-Clause" }
license = "BSD-3-Clause"
readme = "README.md"
requires-python = ">=3.6"
dependencies = [
Expand All @@ -22,7 +22,6 @@ dependencies = [
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand All @@ -47,3 +46,6 @@ exclude = ["tests", "examples"]

[tool.setuptools.dynamic]
version = { attr = "meterbus.__version__" }

[project.optional-dependencies]
test = ["pytest", "pytest-cov"]
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pycryptodome==3.19.1
# via -r requirements.in
pyserial==3.5
# via -r requirements.in
pyyaml==6.0
pyyaml>=6.0.1
# via -r requirements.in
simplejson==3.17.6
# via -r requirements.in
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Inside of setup.cfg
[metadata]
description-file = README.md
description_file = README.md
license_file = LICENSE
13 changes: 13 additions & 0 deletions tests/test_variable_data_record.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ def test_verify_ustr_value(self):

def test_json_record0(self):
dict_record = {
"raw_vib": [253, 27],
"value": 0,
"unit": "MeasureUnit.NONE",
"type": "VIFUnitExt.DIGITAL_INPUT",
Expand All @@ -116,6 +117,7 @@ def test_json_record0(self):

def test_json_record1(self):
dict_record = {
"raw_vib": [252, 116],
"value": 45.64,
"unit": "%RH",
"type": "VIFUnit.VARIABLE_VIF",
Expand All @@ -127,6 +129,7 @@ def test_json_record1(self):

def test_json_record2(self):
dict_record = {
"raw_vib": [252, 116],
"value": 45.52,
"unit": "%RH",
"type": "VIFUnit.VARIABLE_VIF",
Expand All @@ -141,6 +144,7 @@ def test_json_record2(self):

def test_json_record4(self):
dict_record = {
"raw_vib": [101],
"value": 22.56,
"unit": "MeasureUnit.C",
"type": "VIFUnit.EXTERNAL_TEMPERATURE",
Expand All @@ -152,6 +156,7 @@ def test_json_record4(self):

def test_json_record5(self):
dict_record = {
"raw_vib": [101],
"value": 21.60,
"unit": "MeasureUnit.C",
"type": "VIFUnit.EXTERNAL_TEMPERATURE",
Expand All @@ -163,6 +168,7 @@ def test_json_record5(self):

def test_json_record6(self):
dict_record = {
"raw_vib": [101],
"value": 23.39,
"unit": "MeasureUnit.C",
"type": "VIFUnit.EXTERNAL_TEMPERATURE",
Expand All @@ -174,6 +180,7 @@ def test_json_record6(self):

def test_json_record7(self):
dict_record = {
"raw_vib": [114],
"value": 86400,
"unit": "MeasureUnit.SECONDS",
"type": "VIFUnit.AVG_DURATION",
Expand All @@ -185,6 +192,7 @@ def test_json_record7(self):

def test_json_record8(self):
dict_record = {
"raw_vib": [101],
"value": 22.76,
"unit": "MeasureUnit.C",
"type": "VIFUnit.EXTERNAL_TEMPERATURE",
Expand All @@ -196,6 +204,7 @@ def test_json_record8(self):

def test_json_record9(self):
dict_record = {
"raw_vib": [101],
"value": 22.69,
"unit": "MeasureUnit.C",
"type": "VIFUnit.EXTERNAL_TEMPERATURE",
Expand All @@ -209,6 +218,7 @@ def test_json_record9(self):

def test_json_record10(self):
dict_record = {
"raw_vib": [120],
"value": 54000834,
"unit": "MeasureUnit.NONE",
"type": "VIFUnit.FABRICATION_NO",
Expand All @@ -220,6 +230,7 @@ def test_json_record10(self):

def test_json_record11(self):
dict_record = {
"raw_vib": [253, 15],
"value": 262144,
"unit": "MeasureUnit.NONE",
"type": "VIFUnitExt.SOFTWARE_VERSION",
Expand All @@ -231,6 +242,7 @@ def test_json_record11(self):

def test_json_record12(self):
dict_record = {
"raw_vib": [131, 59],
"value": 1234567,
"unit": "MeasureUnit.WH",
"type": "VIFUnit.ENERGY_WH",
Expand All @@ -243,6 +255,7 @@ def test_json_record12(self):

def test_json_record13(self):
dict_record = {
"raw_vib": [131, 60],
"value": 1234567,
"unit": "MeasureUnit.WH",
"type": "VIFUnit.ENERGY_WH",
Expand Down