mirror of
https://github.com/home-assistant/core.git
synced 2026-07-03 04:36:04 +01:00
Migrate matter (remaining files) to UnitOfRatio enum (#175038)
This commit is contained in:
@@ -16,10 +16,10 @@ from homeassistant.components.number import (
|
||||
NumberMode,
|
||||
)
|
||||
from homeassistant.const import (
|
||||
PERCENTAGE,
|
||||
EntityCategory,
|
||||
Platform,
|
||||
UnitOfLength,
|
||||
UnitOfRatio,
|
||||
UnitOfTemperature,
|
||||
UnitOfTime,
|
||||
)
|
||||
@@ -354,7 +354,7 @@ DISCOVERY_SCHEMAS = [
|
||||
platform=Platform.NUMBER,
|
||||
entity_description=MatterNumberEntityDescription(
|
||||
key="pump_setpoint",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
native_unit_of_measurement=UnitOfRatio.PERCENTAGE,
|
||||
translation_key="pump_setpoint",
|
||||
native_max_value=100,
|
||||
native_min_value=0.5,
|
||||
@@ -516,7 +516,7 @@ DISCOVERY_SCHEMAS = [
|
||||
entity_description=MatterRangeNumberEntityDescription(
|
||||
key="speaker_setpoint",
|
||||
translation_key="speaker_setpoint",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
native_unit_of_measurement=UnitOfRatio.PERCENTAGE,
|
||||
command=lambda value: clusters.LevelControl.Commands.MoveToLevel(
|
||||
level=int(value)
|
||||
),
|
||||
|
||||
@@ -4566,7 +4566,7 @@
|
||||
'supported_features': 0,
|
||||
'translation_key': 'pump_setpoint',
|
||||
'unique_id': '00000000000004D2-000000000000002C-MatterNodeDevice-1-pump_setpoint-8-0',
|
||||
'unit_of_measurement': '%',
|
||||
'unit_of_measurement': <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_numbers[mock_pump][number.mock_pump_setpoint-state]
|
||||
@@ -4577,7 +4577,7 @@
|
||||
<NumberEntityCapabilityAttribute.MIN: 'min'>: 0.5,
|
||||
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.SLIDER: 'slider'>,
|
||||
<NumberEntityCapabilityAttribute.STEP: 'step'>: 0.5,
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: '%',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.mock_pump_setpoint',
|
||||
@@ -4626,7 +4626,7 @@
|
||||
'supported_features': 0,
|
||||
'translation_key': 'speaker_setpoint',
|
||||
'unique_id': '00000000000004D2-000000000000006B-MatterNodeDevice-1-speaker_setpoint-8-0',
|
||||
'unit_of_measurement': '%',
|
||||
'unit_of_measurement': <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_numbers[mock_speaker][number.mock_speaker_volume-state]
|
||||
@@ -4637,7 +4637,7 @@
|
||||
<NumberEntityCapabilityAttribute.MIN: 'min'>: 0,
|
||||
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.SLIDER: 'slider'>,
|
||||
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1,
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: '%',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfRatio.PERCENTAGE: '%'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.mock_speaker_volume',
|
||||
|
||||
Reference in New Issue
Block a user