Skip to content

Commit

Permalink
Update pymodbus version to fix hass version 2023.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vortizhe committed Sep 11, 2023
1 parent 40abae5 commit ebb9d00
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions custom_components/ingeteam_modbus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Optional

import voluptuous as vol
from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadDecoder

Expand Down Expand Up @@ -216,7 +216,7 @@ def read_modbus_data(self):
)

def read_modbus_data_status(self, registers):
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.Big)
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.BIG)

stop_code = decoder.decode_16bit_uint()
alarm_code = decoder.decode_32bit_uint()
Expand All @@ -243,7 +243,7 @@ def read_modbus_data_status(self, registers):

def read_modbus_data_inverter(self, registers):

decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.Big)
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.BIG)

active_power = decoder.decode_16bit_int()
reactive_power = decoder.decode_16bit_int()
Expand Down Expand Up @@ -309,7 +309,7 @@ def read_modbus_data_inverter(self, registers):
return True

def read_modbus_data_meter(self, registers):
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.Big)
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.BIG)

em_voltage = decoder.decode_16bit_uint()
em_freq = decoder.decode_16bit_uint()
Expand All @@ -330,8 +330,8 @@ def read_modbus_data_meter(self, registers):
return True

def read_modbus_data_pv_field(self, registers, external_pv_data):
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.Big)
external_pv_decoder = BinaryPayloadDecoder.fromRegisters(external_pv_data, byteorder=Endian.Big)
decoder = BinaryPayloadDecoder.fromRegisters(registers, byteorder=Endian.BIG)
external_pv_decoder = BinaryPayloadDecoder.fromRegisters(external_pv_data, byteorder=Endian.BIG)

pv1_voltage = decoder.decode_16bit_uint()
pv1_current = decoder.decode_16bit_uint()
Expand Down Expand Up @@ -360,7 +360,7 @@ def read_modbus_data_pv_field(self, registers, external_pv_data):

def read_modbus_data_battery(self, registers):
decoder = BinaryPayloadDecoder.fromRegisters(
registers, byteorder=Endian.Big, wordorder=Endian.Little
registers, byteorder=Endian.BIG, wordorder=Endian.LITTLE
)

battery_voltage = decoder.decode_16bit_uint()
Expand Down
2 changes: 1 addition & 1 deletion custom_components/ingeteam_modbus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"domain": "ingeteam_modbus",
"name": "Ingeteam Modbus",
"documentation": "https://github.com/vortizhe/home-assistant-ingeteam-modbus",
"requirements": ["pymodbus==2.5.3"],
"requirements": ["pymodbus==3.5.1"],
"codeowners": ["@vortizhe"],
"config_flow": true,
"version": "0.1.3"
Expand Down
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
"name": "Ingeteam Modbus",
"content_in_root": false,
"domains": ["sensor"],
"homeassistant": "2022.7.0",
"homeassistant": "2023.9.1",
"iot_class": "local_poll"
}

0 comments on commit ebb9d00

Please sign in to comment.