mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
parent
64c2340fab
commit
05c1aff0f6
@ -2,7 +2,7 @@
|
|||||||
"domain": "modbus",
|
"domain": "modbus",
|
||||||
"name": "Modbus",
|
"name": "Modbus",
|
||||||
"documentation": "https://www.home-assistant.io/integrations/modbus",
|
"documentation": "https://www.home-assistant.io/integrations/modbus",
|
||||||
"requirements": ["pymodbus==2.5.3"],
|
"requirements": ["pymodbus==3.1.0"],
|
||||||
"codeowners": ["@adamchengtkc", "@janiversen", "@vzahradnik"],
|
"codeowners": ["@adamchengtkc", "@janiversen", "@vzahradnik"],
|
||||||
"quality_scale": "gold",
|
"quality_scale": "gold",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
|
@ -7,8 +7,8 @@ from collections.abc import Callable
|
|||||||
import logging
|
import logging
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from pymodbus.client.sync import (
|
from pymodbus.client import (
|
||||||
BaseModbusClient,
|
ModbusBaseClient,
|
||||||
ModbusSerialClient,
|
ModbusSerialClient,
|
||||||
ModbusTcpClient,
|
ModbusTcpClient,
|
||||||
ModbusUdpClient,
|
ModbusUdpClient,
|
||||||
@ -255,7 +255,7 @@ class ModbusHub:
|
|||||||
"""Initialize the Modbus hub."""
|
"""Initialize the Modbus hub."""
|
||||||
|
|
||||||
# generic configuration
|
# generic configuration
|
||||||
self._client: BaseModbusClient | None = None
|
self._client: ModbusBaseClient | None = None
|
||||||
self._async_cancel_listener: Callable[[], None] | None = None
|
self._async_cancel_listener: Callable[[], None] | None = None
|
||||||
self._in_error = False
|
self._in_error = False
|
||||||
self._lock = asyncio.Lock()
|
self._lock = asyncio.Lock()
|
||||||
@ -380,7 +380,7 @@ class ModbusHub:
|
|||||||
self, unit: int | None, address: int, value: int | list[int], use_call: str
|
self, unit: int | None, address: int, value: int | list[int], use_call: str
|
||||||
) -> ModbusResponse:
|
) -> ModbusResponse:
|
||||||
"""Call sync. pymodbus."""
|
"""Call sync. pymodbus."""
|
||||||
kwargs = {"unit": unit} if unit else {}
|
kwargs = {"slave": unit} if unit else {}
|
||||||
entry = self._pb_call[use_call]
|
entry = self._pb_call[use_call]
|
||||||
try:
|
try:
|
||||||
result = entry.func(address, value, **kwargs)
|
result = entry.func(address, value, **kwargs)
|
||||||
|
@ -1774,7 +1774,7 @@ pymitv==1.4.3
|
|||||||
pymochad==0.2.0
|
pymochad==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.modbus
|
# homeassistant.components.modbus
|
||||||
pymodbus==2.5.3
|
pymodbus==3.1.0
|
||||||
|
|
||||||
# homeassistant.components.monoprice
|
# homeassistant.components.monoprice
|
||||||
pymonoprice==0.4
|
pymonoprice==0.4
|
||||||
|
@ -1272,7 +1272,7 @@ pymeteoclimatic==0.0.6
|
|||||||
pymochad==0.2.0
|
pymochad==0.2.0
|
||||||
|
|
||||||
# homeassistant.components.modbus
|
# homeassistant.components.modbus
|
||||||
pymodbus==2.5.3
|
pymodbus==3.1.0
|
||||||
|
|
||||||
# homeassistant.components.monoprice
|
# homeassistant.components.monoprice
|
||||||
pymonoprice==0.4
|
pymonoprice==0.4
|
||||||
|
Loading…
x
Reference in New Issue
Block a user