mirror of
https://github.com/home-assistant/core.git
synced 2025-12-19 18:38:58 +00:00
Add temperature entities to SmartThings One Door fridge (#158457)
This commit is contained in:
committed by
GitHub
parent
86163252e1
commit
f43dead38c
@@ -41,7 +41,7 @@ async def async_setup_entry(
|
||||
)
|
||||
for device in entry_data.devices.values()
|
||||
for component in device.status
|
||||
if component in ("cooler", "freezer")
|
||||
if component in ("cooler", "freezer", "onedoor")
|
||||
and Capability.THERMOSTAT_COOLING_SETPOINT in device.status[component]
|
||||
)
|
||||
async_add_entities(entities)
|
||||
@@ -176,7 +176,8 @@ class SmartThingsRefrigeratorTemperatureNumberEntity(SmartThingsEntity, NumberEn
|
||||
self._attr_translation_key = {
|
||||
"cooler": "cooler_temperature",
|
||||
"freezer": "freezer_temperature",
|
||||
}[component]
|
||||
"onedoor": "target_temperature",
|
||||
}.get(component)
|
||||
|
||||
@property
|
||||
def range(self) -> dict[str, int]:
|
||||
|
||||
@@ -912,7 +912,9 @@ CAPABILITY_TO_SENSORS: dict[
|
||||
if Capability.CUSTOM_OUTING_MODE in status
|
||||
else None
|
||||
),
|
||||
component_fn=lambda component: component in {"freezer", "cooler"},
|
||||
component_fn=(
|
||||
lambda component: component in {"freezer", "cooler", "onedoor"}
|
||||
),
|
||||
component_translation_key={
|
||||
"freezer": "freezer_temperature",
|
||||
"cooler": "cooler_temperature",
|
||||
@@ -1299,7 +1301,7 @@ class SmartThingsSensor(SmartThingsEntity, SensorEntity):
|
||||
)
|
||||
if self.entity_description.component_translation_key and component != MAIN:
|
||||
self._attr_translation_key = (
|
||||
self.entity_description.component_translation_key[component]
|
||||
self.entity_description.component_translation_key.get(component)
|
||||
)
|
||||
|
||||
@property
|
||||
|
||||
@@ -151,6 +151,9 @@
|
||||
"hood_fan_speed": {
|
||||
"name": "Fan speed"
|
||||
},
|
||||
"target_temperature": {
|
||||
"name": "Target temperature"
|
||||
},
|
||||
"washer_rinse_cycles": {
|
||||
"name": "Rinse cycles",
|
||||
"unit_of_measurement": "cycles"
|
||||
|
||||
@@ -410,6 +410,65 @@
|
||||
'state': '2.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ref_normal_01011_onedoor][number.lodowka_target_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'max': 7,
|
||||
'min': 1,
|
||||
'mode': <NumberMode.AUTO: 'auto'>,
|
||||
'step': 1,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'number',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'number.lodowka_target_temperature',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Target temperature',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'target_temperature',
|
||||
'unique_id': '271d82e0-5b0c-e4b8-058e-cdf23a188610_onedoor_thermostatCoolingSetpoint_coolingSetpoint_coolingSetpoint',
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ref_normal_01011_onedoor][number.lodowka_target_temperature-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'temperature',
|
||||
'friendly_name': 'Lodówka Target temperature',
|
||||
'max': 7,
|
||||
'min': 1,
|
||||
'mode': <NumberMode.AUTO: 'auto'>,
|
||||
'step': 1,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.lodowka_target_temperature',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '3',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_wm_wm_000001][number.washer_rinse_cycles-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
@@ -9367,6 +9367,62 @@
|
||||
'state': '0.00027936416665713',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ref_normal_01011_onedoor][sensor.lodowka_temperature-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'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.lodowka_temperature',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 1,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Temperature',
|
||||
'platform': 'smartthings',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': None,
|
||||
'unique_id': '271d82e0-5b0c-e4b8-058e-cdf23a188610_onedoor_temperatureMeasurement_temperature_temperature',
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_ref_normal_01011_onedoor][sensor.lodowka_temperature-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'temperature',
|
||||
'friendly_name': 'Lodówka Temperature',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.lodowka_temperature',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '3',
|
||||
})
|
||||
# ---
|
||||
# name: test_all_entities[da_rvc_map_01011][sensor.robot_vacuum_battery-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
Reference in New Issue
Block a user