mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Improve naming of miele freezers and fridges (#144062)
* Use device class transation * Improve naming of miele freezers and fridges * Address review * Address review comment * Simplify
This commit is contained in:
parent
4967c287f8
commit
762d284102
@ -174,6 +174,11 @@ class MieleClimate(MieleEntity, ClimateEntity):
|
|||||||
t_key = ZONE1_DEVICES.get(
|
t_key = ZONE1_DEVICES.get(
|
||||||
cast(MieleAppliance, self.device.device_type), "zone_1"
|
cast(MieleAppliance, self.device.device_type), "zone_1"
|
||||||
)
|
)
|
||||||
|
if self.device.device_type in (
|
||||||
|
MieleAppliance.FRIDGE,
|
||||||
|
MieleAppliance.FREEZER,
|
||||||
|
):
|
||||||
|
self._attr_name = None
|
||||||
|
|
||||||
if description.zone == 2:
|
if description.zone == 2:
|
||||||
if self.device.device_type in (
|
if self.device.device_type in (
|
||||||
@ -192,8 +197,7 @@ class MieleClimate(MieleEntity, ClimateEntity):
|
|||||||
@property
|
@property
|
||||||
def target_temperature(self) -> float | None:
|
def target_temperature(self) -> float | None:
|
||||||
"""Return the target temperature."""
|
"""Return the target temperature."""
|
||||||
if self.entity_description.target_fn(self.device) is None:
|
|
||||||
return None
|
|
||||||
return cast(float | None, self.entity_description.target_fn(self.device))
|
return cast(float | None, self.entity_description.target_fn(self.device))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# serializer version: 1
|
# serializer version: 1
|
||||||
# name: test_climate_states[platforms0-freezer][climate.freezer_freezer-entry]
|
# name: test_climate_states[platforms0-freezer][climate.freezer-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
}),
|
}),
|
||||||
@ -19,7 +19,7 @@
|
|||||||
'disabled_by': None,
|
'disabled_by': None,
|
||||||
'domain': 'climate',
|
'domain': 'climate',
|
||||||
'entity_category': None,
|
'entity_category': None,
|
||||||
'entity_id': 'climate.freezer_freezer',
|
'entity_id': 'climate.freezer',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
'icon': None,
|
'icon': None,
|
||||||
@ -31,7 +31,7 @@
|
|||||||
}),
|
}),
|
||||||
'original_device_class': None,
|
'original_device_class': None,
|
||||||
'original_icon': None,
|
'original_icon': None,
|
||||||
'original_name': 'Freezer',
|
'original_name': None,
|
||||||
'platform': 'miele',
|
'platform': 'miele',
|
||||||
'previous_unique_id': None,
|
'previous_unique_id': None,
|
||||||
'supported_features': <ClimateEntityFeature: 1>,
|
'supported_features': <ClimateEntityFeature: 1>,
|
||||||
@ -40,11 +40,11 @@
|
|||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_climate_states[platforms0-freezer][climate.freezer_freezer-state]
|
# name: test_climate_states[platforms0-freezer][climate.freezer-state]
|
||||||
StateSnapshot({
|
StateSnapshot({
|
||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'current_temperature': -18,
|
'current_temperature': -18,
|
||||||
'friendly_name': 'Freezer Freezer',
|
'friendly_name': 'Freezer',
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.COOL: 'cool'>,
|
<HVACMode.COOL: 'cool'>,
|
||||||
]),
|
]),
|
||||||
@ -55,14 +55,14 @@
|
|||||||
'temperature': -18,
|
'temperature': -18,
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'climate.freezer_freezer',
|
'entity_id': 'climate.freezer',
|
||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_reported': <ANY>,
|
'last_reported': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
'state': 'cool',
|
'state': 'cool',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_climate_states[platforms0-freezer][climate.refrigerator_refrigerator-entry]
|
# name: test_climate_states[platforms0-freezer][climate.refrigerator-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
}),
|
}),
|
||||||
@ -82,7 +82,7 @@
|
|||||||
'disabled_by': None,
|
'disabled_by': None,
|
||||||
'domain': 'climate',
|
'domain': 'climate',
|
||||||
'entity_category': None,
|
'entity_category': None,
|
||||||
'entity_id': 'climate.refrigerator_refrigerator',
|
'entity_id': 'climate.refrigerator',
|
||||||
'has_entity_name': True,
|
'has_entity_name': True,
|
||||||
'hidden_by': None,
|
'hidden_by': None,
|
||||||
'icon': None,
|
'icon': None,
|
||||||
@ -94,7 +94,7 @@
|
|||||||
}),
|
}),
|
||||||
'original_device_class': None,
|
'original_device_class': None,
|
||||||
'original_icon': None,
|
'original_icon': None,
|
||||||
'original_name': 'Refrigerator',
|
'original_name': None,
|
||||||
'platform': 'miele',
|
'platform': 'miele',
|
||||||
'previous_unique_id': None,
|
'previous_unique_id': None,
|
||||||
'supported_features': <ClimateEntityFeature: 1>,
|
'supported_features': <ClimateEntityFeature: 1>,
|
||||||
@ -103,11 +103,11 @@
|
|||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
# name: test_climate_states[platforms0-freezer][climate.refrigerator_refrigerator-state]
|
# name: test_climate_states[platforms0-freezer][climate.refrigerator-state]
|
||||||
StateSnapshot({
|
StateSnapshot({
|
||||||
'attributes': ReadOnlyDict({
|
'attributes': ReadOnlyDict({
|
||||||
'current_temperature': 4,
|
'current_temperature': 4,
|
||||||
'friendly_name': 'Refrigerator Refrigerator',
|
'friendly_name': 'Refrigerator',
|
||||||
'hvac_modes': list([
|
'hvac_modes': list([
|
||||||
<HVACMode.COOL: 'cool'>,
|
<HVACMode.COOL: 'cool'>,
|
||||||
]),
|
]),
|
||||||
@ -118,7 +118,7 @@
|
|||||||
'temperature': 4,
|
'temperature': 4,
|
||||||
}),
|
}),
|
||||||
'context': <ANY>,
|
'context': <ANY>,
|
||||||
'entity_id': 'climate.refrigerator_refrigerator',
|
'entity_id': 'climate.refrigerator',
|
||||||
'last_changed': <ANY>,
|
'last_changed': <ANY>,
|
||||||
'last_reported': <ANY>,
|
'last_reported': <ANY>,
|
||||||
'last_updated': <ANY>,
|
'last_updated': <ANY>,
|
||||||
|
@ -26,7 +26,7 @@ pytestmark = [
|
|||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
ENTITY_ID = "climate.freezer_freezer"
|
ENTITY_ID = "climate.freezer"
|
||||||
SERVICE_SET_TEMPERATURE = "set_temperature"
|
SERVICE_SET_TEMPERATURE = "set_temperature"
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user