mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 17:04:04 -04:00
Wolflink Fix state_class for long term statistics (#173048)
This commit is contained in:
@@ -66,29 +66,34 @@ SENSOR_DESCRIPTIONS = [
|
||||
key="temperature",
|
||||
device_class=SensorDeviceClass.TEMPERATURE,
|
||||
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, Temperature),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="pressure",
|
||||
device_class=SensorDeviceClass.PRESSURE,
|
||||
native_unit_of_measurement=UnitOfPressure.BAR,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, Pressure),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="energy",
|
||||
device_class=SensorDeviceClass.ENERGY,
|
||||
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
supported_fn=lambda param: isinstance(param, EnergyParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="power",
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
native_unit_of_measurement=UnitOfPower.KILO_WATT,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, PowerParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="percentage",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, PercentageParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
@@ -99,20 +104,24 @@ SENSOR_DESCRIPTIONS = [
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="hours",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
icon="mdi:clock",
|
||||
native_unit_of_measurement=UnitOfTime.HOURS,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
supported_fn=lambda param: isinstance(param, HoursParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="flow",
|
||||
device_class=SensorDeviceClass.VOLUME_FLOW_RATE,
|
||||
native_unit_of_measurement=UnitOfVolumeFlowRate.LITERS_PER_MINUTE,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, FlowParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
key="frequency",
|
||||
device_class=SensorDeviceClass.FREQUENCY,
|
||||
native_unit_of_measurement=UnitOfFrequency.HERTZ,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
supported_fn=lambda param: isinstance(param, FrequencyParameter),
|
||||
),
|
||||
WolflinkSensorEntityDescription(
|
||||
|
||||
@@ -36,7 +36,9 @@
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@@ -77,6 +79,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Energy Parameter',
|
||||
'parameter_id': 6005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
'unit_of_measurement': <UnitOfEnergy.KILO_WATT_HOUR: 'kWh'>,
|
||||
'value_id': 6002800000,
|
||||
}),
|
||||
@@ -94,7 +97,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,
|
||||
@@ -135,6 +140,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Flow Parameter',
|
||||
'parameter_id': 11005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfVolumeFlowRate.LITERS_PER_MINUTE: 'L/min'>,
|
||||
'value_id': 1100280001,
|
||||
}),
|
||||
@@ -152,7 +158,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,
|
||||
@@ -193,6 +201,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Frequency Parameter',
|
||||
'parameter_id': 9005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfFrequency.HERTZ: 'Hz'>,
|
||||
'value_id': 9002800000,
|
||||
}),
|
||||
@@ -210,7 +219,9 @@
|
||||
None,
|
||||
]),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@@ -228,8 +239,11 @@
|
||||
'name': None,
|
||||
'object_id_base': 'Hours Parameter',
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 2,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_device_class': <SensorDeviceClass.DURATION: 'duration'>,
|
||||
'original_icon': 'mdi:clock',
|
||||
'original_name': 'Hours Parameter',
|
||||
'platform': 'wolflink',
|
||||
@@ -244,10 +258,12 @@
|
||||
# name: test_sensors[sensor.wolf_smartset_hours_parameter-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'duration',
|
||||
'friendly_name': 'Wolf SmartSet Hours Parameter',
|
||||
'icon': 'mdi:clock',
|
||||
'parameter_id': 7005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
|
||||
'value_id': 7002800000,
|
||||
}),
|
||||
@@ -318,7 +334,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,
|
||||
@@ -355,6 +373,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Percentage Parameter',
|
||||
'parameter_id': 2005200000,
|
||||
'parent': 'Solar',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': '%',
|
||||
'value_id': 2002800000,
|
||||
}),
|
||||
@@ -372,7 +391,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,
|
||||
@@ -413,6 +434,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Power Parameter',
|
||||
'parameter_id': 5005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfPower.KILO_WATT: 'kW'>,
|
||||
'value_id': 5002800000,
|
||||
}),
|
||||
@@ -430,7 +452,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,
|
||||
@@ -471,6 +495,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Pressure Parameter',
|
||||
'parameter_id': 4005200000,
|
||||
'parent': 'Heating',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfPressure.BAR: 'bar'>,
|
||||
'value_id': 4002800000,
|
||||
}),
|
||||
@@ -598,7 +623,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,
|
||||
@@ -639,6 +666,7 @@
|
||||
'friendly_name': 'Wolf SmartSet Temperature Parameter',
|
||||
'parameter_id': 3005200000,
|
||||
'parent': 'Solar',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
'value_id': 3002800000,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user