summaryrefslogtreecommitdiff
path: root/src/home/mqtt/payload/inverter.py
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-12-25 03:01:00 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-12-25 03:01:00 +0300
commite7362bd832915bee0630f05a316b50de651caa19 (patch)
tree416e4e831e3cb8e3b3c54bf4d0adcabf9c759af8 /src/home/mqtt/payload/inverter.py
parented590fdd74a466832ee5bb788c3ea69da2f53a3c (diff)
mqtt/payload: fix bitfields
Diffstat (limited to 'src/home/mqtt/payload/inverter.py')
-rw-r--r--src/home/mqtt/payload/inverter.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/home/mqtt/payload/inverter.py b/src/home/mqtt/payload/inverter.py
index b3f4edd..1d4099c 100644
--- a/src/home/mqtt/payload/inverter.py
+++ b/src/home/mqtt/payload/inverter.py
@@ -1,6 +1,6 @@
import struct
-from .base_payload import MQTTPayload, MQTTPayloadBitField
+from .base_payload import MQTTPayload, bit_field
from typing import Tuple
_mult_10 = lambda n: int(n*10)
@@ -57,12 +57,12 @@ class Status(MQTTPayload):
pv2_input_voltage: float
# H
- mppt1_charger_status: MQTTPayloadBitField[0, 16, 2]
- mppt2_charger_status: MQTTPayloadBitField[0, 16, 2]
- battery_power_direction: MQTTPayloadBitField[0, 16, 2]
- dc_ac_power_direction: MQTTPayloadBitField[0, 16, 2]
- line_power_direction: MQTTPayloadBitField[0, 16, 2]
- load_connected: MQTTPayloadBitField[0, 16, 1]
+ mppt1_charger_status: bit_field(0, 16, 2)
+ mppt2_charger_status: bit_field(0, 16, 2)
+ battery_power_direction: bit_field(0, 16, 2)
+ dc_ac_power_direction: bit_field(0, 16, 2)
+ line_power_direction: bit_field(0, 16, 2)
+ load_connected: bit_field(0, 16, 1)
class Generation(MQTTPayload):