Add Matter BatVoltage attribute from PowerSource cluster (#125503)
* Add BatVoltage Attribute from PowerSource Cluster * Update sensor.py Remove comment * Update homeassistant/components/matter/sensor.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
d7caaceb64
commit
8fff0075ba
1 changed files with 13 additions and 0 deletions
|
@ -163,6 +163,19 @@ DISCOVERY_SCHEMAS = [
|
|||
entity_class=MatterSensor,
|
||||
required_attributes=(clusters.PowerSource.Attributes.BatPercentRemaining,),
|
||||
),
|
||||
MatterDiscoverySchema(
|
||||
platform=Platform.SENSOR,
|
||||
entity_description=MatterSensorEntityDescription(
|
||||
key="PowerSourceBatVoltage",
|
||||
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
|
||||
device_class=SensorDeviceClass.VOLTAGE,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
measurement_to_ha=lambda x: x / 1000,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
entity_class=MatterSensor,
|
||||
required_attributes=(clusters.PowerSource.Attributes.BatVoltage,),
|
||||
),
|
||||
MatterDiscoverySchema(
|
||||
platform=Platform.SENSOR,
|
||||
entity_description=MatterSensorEntityDescription(
|
||||
|
|
Loading…
Add table
Reference in a new issue