Skip to content

Commit b1b88a9

Browse files
Merge pull request #759 from WillCodeForCats/code-quality
Add pymodbus version to diagnostics
2 parents a3e4c11 + eef4e28 commit b1b88a9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

custom_components/solaredge_modbus_multi/diagnostics.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ async def async_get_config_entry_diagnostics(
4242
hub = hass.data[DOMAIN][config_entry.entry_id]["hub"]
4343

4444
data: dict[str, Any] = {
45+
"pymodbus_version": hub.pymodbus_version,
4546
"config_entry": async_redact_data(config_entry.as_dict(), REDACT_CONFIG),
4647
"yaml": async_redact_data(hass.data[DOMAIN]["yaml"], REDACT_CONFIG),
4748
}

custom_components/solaredge_modbus_multi/hub.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@ def __init__(
179179

180180
self._client = None
181181

182+
self._pymodbus_version = pymodbus_version
183+
182184
_LOGGER.debug(
183185
(
184186
f"{DOMAIN} configuration: "
@@ -195,7 +197,7 @@ def __init__(
195197
),
196198
)
197199

198-
_LOGGER.debug(f"pymodbus version {pymodbus_version}")
200+
_LOGGER.debug(f"pymodbus version {self.pymodbus_version}")
199201

200202
async def _async_init_solaredge(self) -> None:
201203
"""Detect devices and load initial modbus data from inverters."""
@@ -721,6 +723,10 @@ def number_of_inverters(self) -> int:
721723
def sleep_after_write(self) -> int:
722724
return self._sleep_after_write
723725

726+
@property
727+
def pymodbus_version(self) -> str:
728+
return self._pymodbus_version
729+
724730
@property
725731
def coordinator_timeout(self) -> int:
726732
if not self.initalized:

0 commit comments

Comments
 (0)