File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
custom_components/victron Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 44import logging
55import threading
66
7+ from packaging import version
8+ import pymodbus
79from pymodbus .client import ModbusTcpClient
810
911from homeassistant .exceptions import HomeAssistantError
@@ -37,8 +39,12 @@ def is_still_connected(self):
3739
3840 def convert_string_from_register (self , segment , string_encoding = "ascii" ):
3941 """Convert from registers to the appropriate data type."""
42+ if version .parse ("3.8.0" ) <= version .parse (pymodbus .__version__ ) <= version .parse ("3.8.4" ):
43+ return self ._client .convert_from_registers (
44+ segment , self ._client .DATATYPE .STRING
45+ ).split ("\x00 " )[0 ]
4046 return self ._client .convert_from_registers (
41- segment , self ._client .DATATYPE .STRING , string_encoding = "ascii"
47+ segment , self ._client .DATATYPE .STRING , string_encoding = string_encoding
4248 ).split ("\x00 " )[0 ]
4349
4450 def convert_number_from_register (self , segment , dataType ):
Original file line number Diff line number Diff line change 1212 "iot_class" : " local_polling" ,
1313 "issue_tracker" : " https://github.com/sfstar/hass-victron/issues" ,
1414 "requirements" : [
15- " pymodbus>=3.7.4 "
15+ " pymodbus>=3.8.0 "
1616 ],
1717 "ssdp" : [],
1818 "version" : " v0.0.0" ,
Original file line number Diff line number Diff line change 44 "zip_release" : true ,
55 "filename" : " victron.zip" ,
66 "hide_default_branch" : false ,
7- "homeassistant" : " 2025.1 " ,
7+ "homeassistant" : " 2025.2 " ,
88 "hacs" : " 1.28.4"
99 }
You can’t perform that action at this time.
0 commit comments