From 5cf1ff979887f2c77d76c2bc2426d893bc267cb1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 3 Sep 2026 10:26:53 +0200 Subject: [PATCH] Address review: distinct fp32_r baseline, note the byte-swapped raw view --- tests/integration/fixtures/uart_mock_modbus_mesh.yaml | 2 +- tests/integration/test_uart_mock_modbus.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/fixtures/uart_mock_modbus_mesh.yaml b/tests/integration/fixtures/uart_mock_modbus_mesh.yaml index 4df585295a..abc03c87cf 100644 --- a/tests/integration/fixtures/uart_mock_modbus_mesh.yaml +++ b/tests/integration/fixtures/uart_mock_modbus_mesh.yaml @@ -105,7 +105,7 @@ globals: initial_value: "3.14" - id: stored_fp32_r type: float - initial_value: "3.14" + initial_value: "2.5" - id: stored_bit_2 type: bool initial_value: "false" diff --git a/tests/integration/test_uart_mock_modbus.py b/tests/integration/test_uart_mock_modbus.py index 6006a0a090..735dd82e8c 100644 --- a/tests/integration/test_uart_mock_modbus.py +++ b/tests/integration/test_uart_mock_modbus.py @@ -53,7 +53,7 @@ MESH_INITIAL_VALUES: dict[str, object] = { "reg_u_qword_r": pytest.approx(578437695752307201), "reg_s_qword_r": pytest.approx(-578437695752307201), "reg_fp32": pytest.approx(3.14), - "reg_fp32_r": pytest.approx(3.14), + "reg_fp32_r": pytest.approx(2.5), } @@ -329,6 +329,7 @@ async def test_uart_mock_modbus_server_controller( line_callback, error_log_lines, warning_log_lines = _make_modbus_line_callback() + # 13330 is the byte-swapped view of reg_u_word_s (0x1234 -> 0x3412) expected_values = {**MESH_INITIAL_VALUES, "reg_u_word_s_raw": 13330} tracker = SensorTracker(list(expected_values.keys())) futures = tracker.expect_all(expected_values)