From 5cc9cc3c99bc6f8a0c1ae22ea2ba2c636a09a630 Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Tue, 10 Jun 2025 20:28:37 +0300 Subject: [PATCH] Fix EntityCategory for binary_sensor platform in Amazon Devices (#146472) * Fix EntityCategory for binary_sensor platform in Amazon Devices * update snapshots --- homeassistant/components/amazon_devices/binary_sensor.py | 3 +++ .../amazon_devices/snapshots/test_binary_sensor.ambr | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/amazon_devices/binary_sensor.py b/homeassistant/components/amazon_devices/binary_sensor.py index 2e41983dda4..ab1fadc7548 100644 --- a/homeassistant/components/amazon_devices/binary_sensor.py +++ b/homeassistant/components/amazon_devices/binary_sensor.py @@ -13,6 +13,7 @@ from homeassistant.components.binary_sensor import ( BinarySensorEntity, BinarySensorEntityDescription, ) +from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback @@ -34,10 +35,12 @@ BINARY_SENSORS: Final = ( AmazonBinarySensorEntityDescription( key="online", device_class=BinarySensorDeviceClass.CONNECTIVITY, + entity_category=EntityCategory.DIAGNOSTIC, is_on_fn=lambda _device: _device.online, ), AmazonBinarySensorEntityDescription( key="bluetooth", + entity_category=EntityCategory.DIAGNOSTIC, translation_key="bluetooth", is_on_fn=lambda _device: _device.bluetooth_state, ), diff --git a/tests/components/amazon_devices/snapshots/test_binary_sensor.ambr b/tests/components/amazon_devices/snapshots/test_binary_sensor.ambr index 0d3a5252a73..e914541d19c 100644 --- a/tests/components/amazon_devices/snapshots/test_binary_sensor.ambr +++ b/tests/components/amazon_devices/snapshots/test_binary_sensor.ambr @@ -11,7 +11,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'binary_sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'binary_sensor.echo_test_bluetooth', 'has_entity_name': True, 'hidden_by': None, @@ -59,7 +59,7 @@ 'device_id': , 'disabled_by': None, 'domain': 'binary_sensor', - 'entity_category': None, + 'entity_category': , 'entity_id': 'binary_sensor.echo_test_connectivity', 'has_entity_name': True, 'hidden_by': None,