Add check for _client existence in modbus (#52719)
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…
Reference in New Issue