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