From 37631d20179f808facbef2d6a30b16187ede2f26 Mon Sep 17 00:00:00 2001 From: Raman Gupta <7243222+raman325@users.noreply.github.com> Date: Thu, 8 Sep 2022 03:13:01 -0400 Subject: [PATCH] Add value ID to zwave_js device diagnostics (#78015) --- homeassistant/components/zwave_js/diagnostics.py | 1 + tests/components/zwave_js/test_diagnostics.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/homeassistant/components/zwave_js/diagnostics.py b/homeassistant/components/zwave_js/diagnostics.py index 078bd761b71..33d32e96fe0 100644 --- a/homeassistant/components/zwave_js/diagnostics.py +++ b/homeassistant/components/zwave_js/diagnostics.py @@ -123,6 +123,7 @@ def get_device_entities( "entity_category": entry.entity_category, "supported_features": entry.supported_features, "unit_of_measurement": entry.unit_of_measurement, + "value_id": value_id, "primary_value": primary_value_data, } entities.append(entity) diff --git a/tests/components/zwave_js/test_diagnostics.py b/tests/components/zwave_js/test_diagnostics.py index 9f3a7b0884c..41505364111 100644 --- a/tests/components/zwave_js/test_diagnostics.py +++ b/tests/components/zwave_js/test_diagnostics.py @@ -152,6 +152,7 @@ async def test_device_diagnostics_missing_primary_value( x for x in diagnostics_data["entities"] if x["entity_id"] == entity_id ) + assert air_entity["value_id"] == value.value_id assert air_entity["primary_value"] == { "command_class": value.command_class, "command_class_name": value.command_class_name, @@ -189,4 +190,5 @@ async def test_device_diagnostics_missing_primary_value( x for x in diagnostics_data["entities"] if x["entity_id"] == entity_id ) + assert air_entity["value_id"] == value.value_id assert air_entity["primary_value"] is None