From 4879d4b4e093af86591e7d73da0d7a8481bce598 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Sep 2026 23:06:33 +0200 Subject: [PATCH] Diagnostic, case normalized number entity lookup --- tests/integration/test_uart_mock_modbus.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_uart_mock_modbus.py b/tests/integration/test_uart_mock_modbus.py index 123d083256..d961ba8e22 100644 --- a/tests/integration/test_uart_mock_modbus.py +++ b/tests/integration/test_uart_mock_modbus.py @@ -401,9 +401,13 @@ async def test_uart_mock_modbus_server_controller_write( # 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)} + numbers = { + e.object_id.lower(): e for e in entities if isinstance(e, NumberInfo) + } for number_name, value in register_writes.values(): - client.number_command(numbers[number_name].key, value) + entity = numbers.get(number_name) + assert entity is not None, f"{number_name} number entity not found" + client.number_command(entity.key, value) # Wait for sensors to reflect the written values (round-trip write+read) await tracker.await_all(written_futures, timeout=4.0)