From e7362bd832915bee0630f05a316b50de651caa19 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Sun, 25 Dec 2022 03:01:00 +0300 Subject: mqtt/payload: fix bitfields --- src/home/mqtt/payload/inverter.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/home/mqtt/payload/inverter.py') 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): -- cgit v1.2.3