From ad06db6ca8dfa9cd0aebc5c1bc58414c8b4fa993 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Sep 2026 21:41:22 +0200 Subject: [PATCH] Address review: exact object_id lookup for the write numbers --- tests/integration/test_uart_mock_modbus.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration/test_uart_mock_modbus.py b/tests/integration/test_uart_mock_modbus.py index 8bfce3577a..123d083256 100644 --- a/tests/integration/test_uart_mock_modbus.py +++ b/tests/integration/test_uart_mock_modbus.py @@ -399,10 +399,11 @@ async def test_uart_mock_modbus_server_controller_write( # connection is working before issuing writes await tracker.await_all(initial_futures, timeout=4.0) - # Issue write commands for all register types + # Issue write commands for all register types; exact object_id match, + # since several write_* names are prefixes of a sibling + numbers = {e.object_id: e for e in entities if isinstance(e, NumberInfo)} for number_name, value in register_writes.values(): - entity = require_entity(entities, number_name, NumberInfo) - client.number_command(entity.key, value) + client.number_command(numbers[number_name].key, value) # Wait for sensors to reflect the written values (round-trip write+read) await tracker.await_all(written_futures, timeout=4.0)