Skip to content

Commit 5b1829f

Browse files
authored
Add hood filter usage entity to SmartThings (home-assistant#157775)
1 parent 520156a commit 5b1829f

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

homeassistant/components/smartthings/sensor.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,6 +1157,17 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription):
11571157
)
11581158
]
11591159
},
1160+
Capability.SAMSUNG_CE_HOOD_FILTER: {
1161+
Attribute.HOOD_FILTER_USAGE: [
1162+
SmartThingsSensorEntityDescription(
1163+
key=Attribute.HOOD_FILTER_USAGE,
1164+
translation_key="hood_filter_usage",
1165+
state_class=SensorStateClass.MEASUREMENT,
1166+
native_unit_of_measurement=PERCENTAGE,
1167+
entity_category=EntityCategory.DIAGNOSTIC,
1168+
)
1169+
]
1170+
},
11601171
}
11611172

11621173

homeassistant/components/smartthings/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@
411411
"simmer": "Simmer"
412412
}
413413
},
414+
"hood_filter_usage": {
415+
"name": "Filter usage"
416+
},
414417
"infrared_level": {
415418
"name": "Infrared level"
416419
},

tests/components/smartthings/snapshots/test_sensor.ambr

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4776,6 +4776,58 @@
47764776
'state': '0.0',
47774777
})
47784778
# ---
4779+
# name: test_all_entities[da_ks_hood_01001][sensor.range_hood_filter_usage-entry]
4780+
EntityRegistryEntrySnapshot({
4781+
'aliases': set({
4782+
}),
4783+
'area_id': None,
4784+
'capabilities': dict({
4785+
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
4786+
}),
4787+
'config_entry_id': <ANY>,
4788+
'config_subentry_id': <ANY>,
4789+
'device_class': None,
4790+
'device_id': <ANY>,
4791+
'disabled_by': None,
4792+
'domain': 'sensor',
4793+
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
4794+
'entity_id': 'sensor.range_hood_filter_usage',
4795+
'has_entity_name': True,
4796+
'hidden_by': None,
4797+
'icon': None,
4798+
'id': <ANY>,
4799+
'labels': set({
4800+
}),
4801+
'name': None,
4802+
'options': dict({
4803+
}),
4804+
'original_device_class': None,
4805+
'original_icon': None,
4806+
'original_name': 'Filter usage',
4807+
'platform': 'smartthings',
4808+
'previous_unique_id': None,
4809+
'suggested_object_id': None,
4810+
'supported_features': 0,
4811+
'translation_key': 'hood_filter_usage',
4812+
'unique_id': 'fa5fca25-fa7a-1807-030a-2f72ee0f7bff_main_samsungce.hoodFilter_hoodFilterUsage_hoodFilterUsage',
4813+
'unit_of_measurement': '%',
4814+
})
4815+
# ---
4816+
# name: test_all_entities[da_ks_hood_01001][sensor.range_hood_filter_usage-state]
4817+
StateSnapshot({
4818+
'attributes': ReadOnlyDict({
4819+
'friendly_name': 'Range hood Filter usage',
4820+
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
4821+
'unit_of_measurement': '%',
4822+
}),
4823+
'context': <ANY>,
4824+
'entity_id': 'sensor.range_hood_filter_usage',
4825+
'last_changed': <ANY>,
4826+
'last_reported': <ANY>,
4827+
'last_updated': <ANY>,
4828+
'state': '100',
4829+
})
4830+
# ---
47794831
# name: test_all_entities[da_ks_hood_01001][sensor.range_hood_pm1-entry]
47804832
EntityRegistryEntrySnapshot({
47814833
'aliases': set({

0 commit comments

Comments
 (0)