Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded call active check in modbus #136487

Merged
merged 3 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions homeassistant/components/modbus/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,9 @@ async def _async_update(self) -> None:
"""Update the state of the sensor."""

# do not allow multiple active calls to the same platform
if self._call_active:
return
self._call_active = True
result = await self._hub.async_pb_call(
self._slave, self._address, self._count, self._input_type
)
self._call_active = False
if result is None:
self._attr_available = False
self._result = []
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/modbus/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def __init__(
self._input_type = entry[CONF_INPUT_TYPE]
self._value: str | None = None
self._scan_interval = int(entry[CONF_SCAN_INTERVAL])
self._call_active = False
self._cancel_timer: Callable[[], None] | None = None
self._cancel_call: Callable[[], None] | None = None

Expand Down Expand Up @@ -389,13 +388,9 @@ async def _async_update(self) -> None:
return

# do not allow multiple active calls to the same platform
if self._call_active:
return
self._call_active = True
result = await self._hub.async_pb_call(
self._slave, self._verify_address, 1, self._verify_type
)
self._call_active = False
if result is None:
self._attr_available = False
return
Expand Down