mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Also migrate completion time entities in SmartThings (#141572)
This commit is contained in:
parent
f0fd5a639a
commit
62be82fd3c
@ -352,7 +352,10 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
return {
|
||||
"new_unique_id": f"{device_id}_{MAIN}_{Capability.THREE_AXIS}_{Attribute.THREE_AXIS}_{new_attribute}",
|
||||
}
|
||||
if attribute == Attribute.MACHINE_STATE:
|
||||
if attribute in {
|
||||
Attribute.MACHINE_STATE,
|
||||
Attribute.COMPLETION_TIME,
|
||||
}:
|
||||
capability = determine_machine_type(
|
||||
hass, entry.entry_id, device_id
|
||||
)
|
||||
|
@ -529,12 +529,28 @@ async def test_entity_unique_id_migration(
|
||||
"microwave_machine_state",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_machineState_machineState",
|
||||
),
|
||||
(
|
||||
"da_ks_microwave_0101x",
|
||||
SENSOR_DOMAIN,
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a.ovenJobState",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a.completionTime",
|
||||
"microwave_completion_time",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_ks_microwave_0101x",
|
||||
SENSOR_DOMAIN,
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_ovenJobState_ovenJobState",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a.completionTime",
|
||||
"microwave_completion_time",
|
||||
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_dw_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.dishwasherJobState",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.machineState",
|
||||
"microwave_machine_state",
|
||||
"dishwasher_machine_state",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_machineState_machineState",
|
||||
),
|
||||
(
|
||||
@ -542,9 +558,25 @@ async def test_entity_unique_id_migration(
|
||||
SENSOR_DOMAIN,
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_dishwasherJobState_dishwasherJobState",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.machineState",
|
||||
"microwave_machine_state",
|
||||
"dishwasher_machine_state",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_machineState_machineState",
|
||||
),
|
||||
(
|
||||
"da_wm_dw_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.dishwasherJobState",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.completionTime",
|
||||
"dishwasher_completion_time",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_dw_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_dishwasherJobState_dishwasherJobState",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.completionTime",
|
||||
"dishwasher_completion_time",
|
||||
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_wd_000001",
|
||||
SENSOR_DOMAIN,
|
||||
@ -561,6 +593,22 @@ async def test_entity_unique_id_migration(
|
||||
"dryer_machine_state",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_machineState_machineState",
|
||||
),
|
||||
(
|
||||
"da_wm_wd_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b.dryerJobState",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b.completionTime",
|
||||
"dryer_completion_time",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_wd_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_dryerJobState_dryerJobState",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b.completionTime",
|
||||
"dryer_completion_time",
|
||||
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_wm_000001",
|
||||
SENSOR_DOMAIN,
|
||||
@ -577,6 +625,22 @@ async def test_entity_unique_id_migration(
|
||||
"washer_machine_state",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState",
|
||||
),
|
||||
(
|
||||
"da_wm_wm_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47.washerJobState",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47.completionTime",
|
||||
"washer_completion_time",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_completionTime_completionTime",
|
||||
),
|
||||
(
|
||||
"da_wm_wm_000001",
|
||||
SENSOR_DOMAIN,
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_washerJobState_washerJobState",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47.completionTime",
|
||||
"washer_completion_time",
|
||||
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_completionTime_completionTime",
|
||||
),
|
||||
],
|
||||
)
|
||||
async def test_entity_unique_id_migration_machine_state(
|
||||
|
Loading…
x
Reference in New Issue
Block a user