mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 09:47:13 +00:00
Add check for _client existence in modbus (#52719)
This commit is contained in:
parent
578c897161
commit
fe1f7ba316
@ -633,6 +633,7 @@ omit =
|
||||
homeassistant/components/mjpeg/camera.py
|
||||
homeassistant/components/mochad/*
|
||||
homeassistant/components/modbus/climate.py
|
||||
homeassistant/components/modbus/modbus.py
|
||||
homeassistant/components/modem_callerid/sensor.py
|
||||
homeassistant/components/motion_blinds/__init__.py
|
||||
homeassistant/components/motion_blinds/const.py
|
||||
|
@ -310,6 +310,8 @@ class ModbusHub:
|
||||
"""Convert async to sync pymodbus call."""
|
||||
if self._config_delay:
|
||||
return None
|
||||
if not self._client:
|
||||
return None
|
||||
if not self._client.is_socket_open():
|
||||
return None
|
||||
async with self._lock:
|
||||
|
Loading…
x
Reference in New Issue
Block a user