Skip to content
Open
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
4 changes: 2 additions & 2 deletions homeassistant/components/airgradient/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class AirGradientConfigSensorEntityDescription(SensorEntityDescription):
key="nox_learning_offset",
translation_key="nox_learning_offset",
device_class=SensorDeviceClass.DURATION,
native_unit_of_measurement=UnitOfTime.DAYS,
native_unit_of_measurement=UnitOfTime.HOURS,
entity_category=EntityCategory.DIAGNOSTIC,
config_key="nox_learning_offset",
value_fn=lambda config: config.nox_learning_offset,
Expand All @@ -245,7 +245,7 @@ class AirGradientConfigSensorEntityDescription(SensorEntityDescription):
key="tvoc_learning_offset",
translation_key="tvoc_learning_offset",
device_class=SensorDeviceClass.DURATION,
native_unit_of_measurement=UnitOfTime.DAYS,
native_unit_of_measurement=UnitOfTime.HOURS,
entity_category=EntityCategory.DIAGNOSTIC,
config_key="tvoc_learning_offset",
value_fn=lambda config: config.tvoc_learning_offset,
Expand Down
24 changes: 12 additions & 12 deletions tests/components/airgradient/snapshots/test_sensor.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -538,15 +538,15 @@
'supported_features': 0,
'translation_key': 'nox_learning_offset',
'unique_id': '84fce612f5b8-nox_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_all_entities[indoor][sensor.airgradient_nox_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient NOx index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_nox_index_learning_offset',
Expand Down Expand Up @@ -1141,15 +1141,15 @@
'supported_features': 0,
'translation_key': 'tvoc_learning_offset',
'unique_id': '84fce612f5b8-tvoc_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_all_entities[indoor][sensor.airgradient_voc_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient VOC index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_voc_index_learning_offset',
Expand Down Expand Up @@ -1304,15 +1304,15 @@
'supported_features': 0,
'translation_key': 'nox_learning_offset',
'unique_id': '84fce612f5b8-nox_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_all_entities[outdoor][sensor.airgradient_nox_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient NOx index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_nox_index_learning_offset',
Expand Down Expand Up @@ -1575,15 +1575,15 @@
'supported_features': 0,
'translation_key': 'tvoc_learning_offset',
'unique_id': '84fce612f5b8-tvoc_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_all_entities[outdoor][sensor.airgradient_voc_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient VOC index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_voc_index_learning_offset',
Expand Down Expand Up @@ -2139,15 +2139,15 @@
'supported_features': 0,
'translation_key': 'nox_learning_offset',
'unique_id': '84fce612f5b8-nox_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_v1_entities[sensor.airgradient_nox_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient NOx index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_nox_index_learning_offset',
Expand Down Expand Up @@ -2957,15 +2957,15 @@
'supported_features': 0,
'translation_key': 'tvoc_learning_offset',
'unique_id': '84fce612f5b8-tvoc_learning_offset',
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
'unit_of_measurement': <UnitOfTime.HOURS: 'h'>,
})
# ---
# name: test_v1_entities[sensor.airgradient_voc_index_learning_offset-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'duration',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airgradient VOC index learning offset',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.DAYS: 'd'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.HOURS: 'h'>,
}),
'context': <ANY>,
'entity_id': 'sensor.airgradient_voc_index_learning_offset',
Expand Down
Loading