Set Matter battery sensors as diagnostic (#95794)
* Set matter battery sensor to diagnostic * Update tests * Use new eve contact sensor dump across the board * Assert entity category * Complete typing
This commit is contained in:
parent
6964a2112a
commit
02192ddf82
8 changed files with 455 additions and 120 deletions
|
@ -13,7 +13,7 @@ from homeassistant.components.binary_sensor import (
|
|||
BinarySensorEntityDescription,
|
||||
)
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.const import EntityCategory, Platform
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
|
||||
|
@ -99,6 +99,7 @@ DISCOVERY_SCHEMAS = [
|
|||
entity_description=MatterBinarySensorEntityDescription(
|
||||
key="BatteryChargeLevel",
|
||||
device_class=BinarySensorDeviceClass.BATTERY,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
measurement_to_ha=lambda x: x
|
||||
!= clusters.PowerSource.Enums.BatChargeLevelEnum.kOk,
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue