mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Add SmartThings water consumption sensor (#142765)
* Add SmartThings water consumption sensor * Update water consumption sensor * Partly revert changes UnitOfVolume * Fix * Fix --------- Co-authored-by: Joostlek <joostlek@outlook.com>
This commit is contained in:
parent
9732b8c0dd
commit
24803b1e75
@ -990,6 +990,18 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
)
|
||||
],
|
||||
},
|
||||
Capability.SAMSUNG_CE_WATER_CONSUMPTION_REPORT: {
|
||||
Attribute.WATER_CONSUMPTION: [
|
||||
SmartThingsSensorEntityDescription(
|
||||
key=Attribute.WATER_CONSUMPTION,
|
||||
translation_key="water_consumption",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
device_class=SensorDeviceClass.WATER,
|
||||
native_unit_of_measurement=UnitOfVolume.LITERS,
|
||||
value_fn=lambda value: value["cumulativeAmount"] / 1000,
|
||||
)
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
|
@ -487,6 +487,9 @@
|
||||
"wrinkle_prevent": "[%key:component::smartthings::entity::sensor::dishwasher_job_state::state::wrinkle_prevent%]",
|
||||
"freeze_protection": "Freeze protection"
|
||||
}
|
||||
},
|
||||
"water_consumption": {
|
||||
"name": "Water consumption"
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
|
@ -8494,6 +8494,58 @@
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_water_consumption-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.machine_a_laver_water_consumption',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.WATER: 'water'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Water consumption',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'water_consumption',
|
||||
'unique_id': 'b854ca5f-dc54-140d-6349-758b4d973c41_main_samsungce.waterConsumptionReport_waterConsumption_waterConsumption',
|
||||
'unit_of_measurement': <UnitOfVolume.LITERS: 'L'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wm_01011][sensor.machine_a_laver_water_consumption-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'water',
|
||||
'friendly_name': 'Machine à Laver Water consumption',
|
||||
'state_class': <SensorStateClass.TOTAL_INCREASING: 'total_increasing'>,
|
||||
'unit_of_measurement': <UnitOfVolume.LITERS: 'L'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.machine_a_laver_water_consumption',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '1642.2',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[ecobee_sensor][sensor.child_bedroom_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
Loading…
x
Reference in New Issue
Block a user