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:
Martin Hjelmare 2023-07-04 14:54:37 +02:00 committed by GitHub
parent 6964a2112a
commit 02192ddf82
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 455 additions and 120 deletions

View file

@ -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,
),