Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions homeassistant/components/gardena_bluetooth/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,15 @@ def context(self) -> set[str]:
key=FlowStatistics.overall.unique_id,
translation_key="flow_statistics_overall",
state_class=SensorStateClass.TOTAL_INCREASING,
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.WATER,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfVolume.LITERS,
char=FlowStatistics.overall,
),
GardenaBluetoothSensorEntityDescription(
key=FlowStatistics.current.unique_id,
translation_key="flow_statistics_current",
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.VOLUME_FLOW_RATE,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
Expand All @@ -150,7 +151,7 @@ def context(self) -> set[str]:
key=FlowStatistics.resettable.unique_id,
translation_key="flow_statistics_resettable",
state_class=SensorStateClass.TOTAL_INCREASING,
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.WATER,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=UnitOfVolume.LITERS,
char=FlowStatistics.resettable,
Expand All @@ -166,6 +167,7 @@ def context(self) -> set[str]:
GardenaBluetoothSensorEntityDescription(
key=Spray.current_distance.unique_id,
translation_key="spray_current_distance",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
native_unit_of_measurement=PERCENTAGE,
char=Spray.current_distance,
Expand Down
14 changes: 10 additions & 4 deletions tests/components/gardena_bluetooth/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
None,
]),
'area_id': None,
'capabilities': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
Expand Down Expand Up @@ -127,6 +129,7 @@
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Mock Title Current distance',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
}),
'context': <ANY>,
Expand All @@ -143,7 +146,9 @@
None,
]),
'area_id': None,
'capabilities': None,
'capabilities': dict({
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
Expand Down Expand Up @@ -182,6 +187,7 @@
'attributes': ReadOnlyDict({
'device_class': 'volume_flow_rate',
'friendly_name': 'Mock Title Current flow',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_MINUTE: 'L/min'>,
}),
'context': <ANY>,
Expand Down Expand Up @@ -399,7 +405,7 @@
'suggested_display_precision': 2,
}),
}),
'original_device_class': <SensorDeviceClass.VOLUME: 'volume'>,
'original_device_class': <SensorDeviceClass.WATER: 'water'>,
'original_icon': None,
'original_name': 'Overall flow',
'platform': 'gardena_bluetooth',
Expand All @@ -414,7 +420,7 @@
# name: test_sensors[aqua_contour][sensor.mock_title_overall_flow-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'volume',
'device_class': 'water',
'friendly_name': 'Mock Title Overall flow',
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
'unit_of_measurement': <UnitOfVolume.LITERS: 'L'>,
Expand Down