From c50f4d6d2dfbfbab29dc2efb6502bbb7e155463c Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 9 Dec 2025 17:29:11 +0100 Subject: [PATCH] Add Tuya local_strategy to Tuya diagnostic (#158450) --- homeassistant/components/tuya/diagnostics.py | 1 + tests/components/tuya/conftest.py | 1 + tests/components/tuya/snapshots/test_diagnostics.ambr | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/homeassistant/components/tuya/diagnostics.py b/homeassistant/components/tuya/diagnostics.py index ec7fa3cb140..78a3d7631c3 100644 --- a/homeassistant/components/tuya/diagnostics.py +++ b/homeassistant/components/tuya/diagnostics.py @@ -98,6 +98,7 @@ def _async_device_as_dict( "home_assistant": {}, "set_up": device.set_up, "support_local": device.support_local, + "local_strategy": device.local_strategy, "warnings": DEVICE_WARNINGS.get(device.id), } diff --git a/tests/components/tuya/conftest.py b/tests/components/tuya/conftest.py index 30a76ba3809..d74fae6be7d 100644 --- a/tests/components/tuya/conftest.py +++ b/tests/components/tuya/conftest.py @@ -176,6 +176,7 @@ async def _create_device(hass: HomeAssistant, mock_device_code: str) -> Customer if device.update_time: device.update_time = int(dt_util.as_timestamp(device.update_time)) device.support_local = details.get("support_local") + device.local_strategy = details.get("local_strategy") device.mqtt_connected = details.get("mqtt_connected") device.function = { diff --git a/tests/components/tuya/snapshots/test_diagnostics.ambr b/tests/components/tuya/snapshots/test_diagnostics.ambr index 54e31002f16..5901af7c847 100644 --- a/tests/components/tuya/snapshots/test_diagnostics.ambr +++ b/tests/components/tuya/snapshots/test_diagnostics.ambr @@ -198,6 +198,7 @@ 'name_by_user': None, }), 'id': '2pxfek1jjrtctiyglam', + 'local_strategy': None, 'mqtt_connected': True, 'name': 'Multifunction alarm', 'online': True, @@ -369,6 +370,7 @@ 'name_by_user': None, }), 'id': 'cwwk68dyfsh2eqi4jbqr', + 'local_strategy': None, 'mqtt_connected': True, 'name': 'Gas sensor', 'online': True, @@ -512,6 +514,7 @@ 'name_by_user': None, }), 'id': 'vrhdtr5fawoiyth9qdt', + 'local_strategy': None, 'mqtt_connected': True, 'name': 'Framboisiers', 'online': True, @@ -644,6 +647,7 @@ 'name_by_user': None, }), 'id': 'cwwk68dyfsh2eqi4jbqr', + 'local_strategy': None, 'name': 'Gas sensor', 'online': True, 'product_id': '4iqe2hsfyd86kwwc',