Add Withings metabolic age sensor (#189782)

Co-authored-by: SH1FT-W <186210246+SH1FT-W@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SH1FT-W
2026-11-01 09:54:26 +01:00
committed by GitHub
co-authored by SH1FT-W Claude Opus 5.5
parent f2645eec06
commit ed29336e16
5 changed files with 80 additions and 0 deletions
@@ -238,6 +238,13 @@ MEASUREMENT_SENSORS: dict[
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
MeasurementType.METABOLIC_AGE: WithingsMeasurementSensorEntityDescription(
key="metabolic_age",
measurement_type=MeasurementType.METABOLIC_AGE,
translation_key="metabolic_age",
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
MeasurementType.VISCERAL_FAT: WithingsMeasurementSensorEntityDescription(
key="visceral_fat",
measurement_type=MeasurementType.VISCERAL_FAT,
@@ -180,6 +180,9 @@
"maximum_respiratory_rate": {
"name": "Maximum respiratory rate"
},
"metabolic_age": {
"name": "Metabolic age"
},
"minimum_heart_rate": {
"name": "Minimum heart rate"
},
@@ -550,6 +550,13 @@
"fm": 3,
"position": 7
},
{
"value": 31,
"type": 227,
"unit": 0,
"algo": 218235904,
"fm": 3
},
{
"value": 19467,
"type": 6,
@@ -793,6 +800,13 @@
"fm": 3,
"position": 7
},
{
"value": 32,
"type": 227,
"unit": 0,
"algo": 218235904,
"fm": 3
},
{
"value": 18457,
"type": 6,
@@ -28,6 +28,7 @@
'intracellular_water',
'visceral_fat',
'basal_metabolic_rate',
'metabolic_age',
'fat_ratio',
'height',
'temperature',
@@ -103,6 +104,7 @@
'intracellular_water',
'visceral_fat',
'basal_metabolic_rate',
'metabolic_age',
'fat_ratio',
'height',
'temperature',
@@ -178,6 +180,7 @@
'intracellular_water',
'visceral_fat',
'basal_metabolic_rate',
'metabolic_age',
'fat_ratio',
'height',
'temperature',
@@ -2607,6 +2607,59 @@
'state': '20',
})
# ---
# name: test_all_entities[sensor.henk_metabolic_age-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': None,
'device_class': None,
'device_id': <DeviceEntry identifiers=[('withings', '12345')]>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.henk_metabolic_age',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Metabolic age',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Metabolic age',
'platform': 'withings',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'metabolic_age',
'unique_id': 'withings_12345_metabolic_age',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[sensor.henk_metabolic_age-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'henk Metabolic age',
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'context': <ANY>,
'entity_id': 'sensor.henk_metabolic_age',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '32',
})
# ---
# name: test_all_entities[sensor.henk_minimum_heart_rate-entry]
EntityRegistryEntrySnapshot({
'aliases': list([