diff --git a/homeassistant/components/miele/entity.py b/homeassistant/components/miele/entity.py index 57c10f6f7bd..8cb4db6bbe0 100644 --- a/homeassistant/components/miele/entity.py +++ b/homeassistant/components/miele/entity.py @@ -37,8 +37,8 @@ class MieleEntity(CoordinatorEntity[MieleDataUpdateCoordinator]): self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, device_id)}, serial_number=device_id, - name=appliance_type or device.tech_type, - translation_key=appliance_type, + name=device.device_name or appliance_type or device.tech_type, + translation_key=None if device.device_name else appliance_type, manufacturer=MANUFACTURER, model=device.tech_type, hw_version=device.xkm_tech_type, diff --git a/tests/components/miele/snapshots/test_sensor.ambr b/tests/components/miele/snapshots/test_sensor.ambr index 19807bff487..1223dab940e 100644 --- a/tests/components/miele/snapshots/test_sensor.ambr +++ b/tests/components/miele/snapshots/test_sensor.ambr @@ -1854,7 +1854,7 @@ 'state': '-18.0', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1888,7 +1888,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction', + 'entity_id': 'sensor.kdma7774_app2_2', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -1910,11 +1910,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction', + 'friendly_name': 'KDMA7774 | APP2-2', 'icon': 'mdi:pot-steam-outline', 'options': list([ 'autocleaning', @@ -1938,14 +1938,14 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction', + 'entity_id': 'sensor.kdma7774_app2_2', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'in_use', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_1-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_1-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -1983,7 +1983,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction_plate_1', + 'entity_id': 'sensor.kdma7774_app2_2_plate_1', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2005,11 +2005,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_1-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_1-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction Plate 1', + 'friendly_name': 'KDMA7774 | APP2-2 Plate 1', 'options': list([ 'plate_step_0', 'plate_step_1', @@ -2036,14 +2036,14 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction_plate_1', + 'entity_id': 'sensor.kdma7774_app2_2_plate_1', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'plate_step_0', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_2-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_2-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2081,7 +2081,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction_plate_2', + 'entity_id': 'sensor.kdma7774_app2_2_plate_2', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2103,11 +2103,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_2-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_2-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction Plate 2', + 'friendly_name': 'KDMA7774 | APP2-2 Plate 2', 'options': list([ 'plate_step_0', 'plate_step_1', @@ -2134,14 +2134,14 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction_plate_2', + 'entity_id': 'sensor.kdma7774_app2_2_plate_2', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'plate_step_warming', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_3-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_3-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2179,7 +2179,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction_plate_3', + 'entity_id': 'sensor.kdma7774_app2_2_plate_3', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2201,11 +2201,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_3-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_3-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction Plate 3', + 'friendly_name': 'KDMA7774 | APP2-2 Plate 3', 'options': list([ 'plate_step_0', 'plate_step_1', @@ -2232,14 +2232,14 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction_plate_3', + 'entity_id': 'sensor.kdma7774_app2_2_plate_3', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'plate_step_8', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_4-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_4-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2277,7 +2277,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction_plate_4', + 'entity_id': 'sensor.kdma7774_app2_2_plate_4', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2299,11 +2299,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_4-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_4-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction Plate 4', + 'friendly_name': 'KDMA7774 | APP2-2 Plate 4', 'options': list([ 'plate_step_0', 'plate_step_1', @@ -2330,14 +2330,14 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction_plate_4', + 'entity_id': 'sensor.kdma7774_app2_2_plate_4', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'plate_step_15', }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_5-entry] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_5-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -2375,7 +2375,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': None, - 'entity_id': 'sensor.hob_with_extraction_plate_5', + 'entity_id': 'sensor.kdma7774_app2_2_plate_5', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -2397,11 +2397,11 @@ 'unit_of_measurement': None, }) # --- -# name: test_hob_sensor_states[platforms0-hob.json][sensor.hob_with_extraction_plate_5-state] +# name: test_hob_sensor_states[platforms0-hob.json][sensor.kdma7774_app2_2_plate_5-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'enum', - 'friendly_name': 'Hob with extraction Plate 5', + 'friendly_name': 'KDMA7774 | APP2-2 Plate 5', 'options': list([ 'plate_step_0', 'plate_step_1', @@ -2428,7 +2428,7 @@ ]), }), 'context': , - 'entity_id': 'sensor.hob_with_extraction_plate_5', + 'entity_id': 'sensor.kdma7774_app2_2_plate_5', 'last_changed': , 'last_reported': , 'last_updated': ,