mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Fix EntityCategory for binary_sensor platform in Amazon Devices (#146472)
* Fix EntityCategory for binary_sensor platform in Amazon Devices * update snapshots
This commit is contained in:
parent
87ce683b39
commit
5cc9cc3c99
@ -13,6 +13,7 @@ from homeassistant.components.binary_sensor import (
|
|||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
BinarySensorEntityDescription,
|
BinarySensorEntityDescription,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
|
||||||
|
|
||||||
@ -34,10 +35,12 @@ BINARY_SENSORS: Final = (
|
|||||||
AmazonBinarySensorEntityDescription(
|
AmazonBinarySensorEntityDescription(
|
||||||
key="online",
|
key="online",
|
||||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
is_on_fn=lambda _device: _device.online,
|
is_on_fn=lambda _device: _device.online,
|
||||||
),
|
),
|
||||||
AmazonBinarySensorEntityDescription(
|
AmazonBinarySensorEntityDescription(
|
||||||
key="bluetooth",
|
key="bluetooth",
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
translation_key="bluetooth",
|
translation_key="bluetooth",
|
||||||
is_on_fn=lambda _device: _device.bluetooth_state,
|
is_on_fn=lambda _device: _device.bluetooth_state,
|
||||||
),
|
),
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
'device_id': <ANY>,
|
'device_id': <ANY>,
|
||||||
'disabled_by': None,
|
'disabled_by': None,
|
||||||
'domain': 'binary_sensor',
|
'domain': 'binary_sensor',
|
||||||
'entity_category': None,
|
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
'entity_id': 'binary_sensor.echo_test_bluetooth',
|
'entity_id': 'binary_sensor.echo_test_bluetooth',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
@ -59,7 +59,7 @@
|
|||||||
'device_id': <ANY>,
|
'device_id': <ANY>,
|
||||||
'disabled_by': None,
|
'disabled_by': None,
|
||||||
'domain': 'binary_sensor',
|
'domain': 'binary_sensor',
|
||||||
'entity_category': None,
|
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
'entity_id': 'binary_sensor.echo_test_connectivity',
|
'entity_id': 'binary_sensor.echo_test_connectivity',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user