Add two states build from the measurements (#351)

* Add two states build from the measurements
- Batterie Status calculated from the batt current
- Power Supply State calc from the out Power

* improve test coverage
This commit is contained in:
Stefan Allius
2025-04-06 01:21:41 +02:00
committed by GitHub
parent 3d073acc58
commit 7782a3cb57
5 changed files with 70 additions and 16 deletions

View File

@@ -43,8 +43,8 @@ class Modbus():
0x000a: {'reg': Register.BATT_PV2_VOLT, 'fmt': '!H', 'ratio': 0.01}, # noqa: E501, PV2 voltage
0x000b: {'reg': Register.BATT_PV2_CUR, 'fmt': '!H', 'ratio': 0.01}, # noqa: E501, PV2 current
0x000c: {'reg': Register.BATT_TOTAL_CHARG, 'fmt': '!L', 'ratio': 0.01}, # noqa: E501
0x000e: {'reg': Register.BATT_STATUS_1, 'fmt': '!H'}, # noqa: E501
0x000f: {'reg': Register.BATT_STATUS_2, 'fmt': '!H'}, # noqa: E501
0x000e: {'reg': Register.BATT_PV1_STATUS, 'fmt': '!H'}, # noqa: E501
0x000f: {'reg': Register.BATT_PV2_STATUS, 'fmt': '!H'}, # noqa: E501
0x0010: {'reg': Register.BATT_VOLT, 'fmt': '!h', 'ratio': 0.01}, # noqa: E501
0x0011: {'reg': Register.BATT_CUR, 'fmt': '!h', 'ratio': 0.01}, # noqa: E501
0x0012: {'reg': Register.BATT_SOC, 'fmt': '!H', 'ratio': 0.01}, # noqa: E501, state of charge (SOC) in percent