Migrate unique ids in SmartThings (#141308)

* Migrate unique ids in SmartThings

* Migrate

* Migrate

* Migrate

* Fix

* Fix
This commit is contained in:
Joost Lekkerkerker 2025-03-26 10:23:20 +01:00 committed by GitHub
parent b5117eb071
commit 63a86763b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 719 additions and 287 deletions

View File

@ -40,14 +40,16 @@ from homeassistant.const import (
)
from homeassistant.core import Event, HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.config_entry_oauth2_flow import (
OAuth2Session,
async_get_config_entry_implementation,
)
from homeassistant.helpers.entity_registry import RegistryEntry, async_migrate_entries
from .const import (
BINARY_SENSOR_ATTRIBUTES_TO_CAPABILITIES,
CONF_INSTALLED_APP_ID,
CONF_LOCATION_ID,
CONF_SUBSCRIPTION_ID,
@ -55,6 +57,7 @@ from .const import (
EVENT_BUTTON,
MAIN,
OLD_DATA,
SENSOR_ATTRIBUTES_TO_CAPABILITIES,
)
_LOGGER = logging.getLogger(__name__)
@ -297,9 +300,109 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry, version=3, data={OLD_DATA: dict(entry.data)}
)
if entry.minor_version < 2:
def migrate_entities(entity_entry: RegistryEntry) -> dict[str, Any] | None:
if entity_entry.domain == "binary_sensor":
device_id, attribute = entity_entry.unique_id.split(".")
if (
capability := BINARY_SENSOR_ATTRIBUTES_TO_CAPABILITIES.get(
attribute
)
) is None:
return None
new_unique_id = (
f"{device_id}_{MAIN}_{capability}_{attribute}_{attribute}"
)
return {
"new_unique_id": new_unique_id,
}
if entity_entry.domain in {"cover", "climate", "fan", "light", "lock"}:
return {"new_unique_id": f"{entity_entry.unique_id}_{MAIN}"}
if entity_entry.domain == "sensor":
delimiter = "." if " " not in entity_entry.unique_id else " "
if delimiter not in entity_entry.unique_id:
return None
device_id, attribute = entity_entry.unique_id.split(
delimiter, maxsplit=1
)
if (
capability := SENSOR_ATTRIBUTES_TO_CAPABILITIES.get(attribute)
) is None:
if attribute in {
"energy_meter",
"power_meter",
"deltaEnergy_meter",
"powerEnergy_meter",
"energySaved_meter",
}:
return {
"new_unique_id": f"{device_id}_{MAIN}_{Capability.POWER_CONSUMPTION_REPORT}_{Attribute.POWER_CONSUMPTION}_{attribute}",
}
if attribute in {
"X Coordinate",
"Y Coordinate",
"Z Coordinate",
}:
new_attribute = {
"X Coordinate": "x_coordinate",
"Y Coordinate": "y_coordinate",
"Z Coordinate": "z_coordinate",
}[attribute]
return {
"new_unique_id": f"{device_id}_{MAIN}_{Capability.THREE_AXIS}_{Attribute.THREE_AXIS}_{new_attribute}",
}
if attribute == Attribute.MACHINE_STATE:
capability = determine_machine_type(
hass, entry.entry_id, device_id
)
if capability is None:
return None
return {
"new_unique_id": f"{device_id}_{MAIN}_{capability}_{attribute}_{attribute}",
}
return None
return {
"new_unique_id": f"{device_id}_{MAIN}_{capability}_{attribute}_{attribute}",
}
if entity_entry.domain == "switch":
return {
"new_unique_id": f"{entity_entry.unique_id}_{MAIN}_{Capability.SWITCH}_{Attribute.SWITCH}_{Attribute.SWITCH}",
}
return None
await async_migrate_entries(hass, entry.entry_id, migrate_entities)
hass.config_entries.async_update_entry(
entry,
minor_version=2,
)
return True
def determine_machine_type(
hass: HomeAssistant,
entry_id: str,
device_id: str,
) -> Capability | None:
"""Determine the machine type for a device."""
entity_registry = er.async_get(hass)
entries = er.async_entries_for_config_entry(entity_registry, entry_id)
device_entries = [entry for entry in entries if device_id in entry.unique_id]
for entry in device_entries:
if Attribute.DISHWASHER_JOB_STATE in entry.unique_id:
return Capability.DISHWASHER_OPERATING_STATE
if Attribute.WASHER_JOB_STATE in entry.unique_id:
return Capability.WASHER_OPERATING_STATE
if Attribute.DRYER_JOB_STATE in entry.unique_id:
return Capability.DRYER_OPERATING_STATE
if Attribute.OVEN_JOB_STATE in entry.unique_id:
return Capability.OVEN_OPERATING_STATE
return None
def create_devices(
device_registry: dr.DeviceRegistry,
devices: dict[str, FullDevice],

View File

@ -229,7 +229,7 @@ class SmartThingsBinarySensor(SmartThingsEntity, BinarySensorEntity):
self._attribute = attribute
self.capability = capability
self.entity_description = entity_description
self._attr_unique_id = f"{device.device.device_id}.{attribute}"
self._attr_unique_id = f"{device.device.device_id}_{component}_{capability}_{attribute}_{attribute}"
if (
entity_description.category_device_class
and (category := get_main_component_category(device))
@ -247,9 +247,6 @@ class SmartThingsBinarySensor(SmartThingsEntity, BinarySensorEntity):
is not None
):
self._attr_translation_key = translation_key
self._attr_unique_id = (
f"{device.device.device_id}_{component}_{capability}_{attribute}"
)
@property
def is_on(self) -> bool:

View File

@ -20,6 +20,7 @@ class SmartThingsConfigFlow(AbstractOAuth2FlowHandler, domain=DOMAIN):
"""Handle configuration of SmartThings integrations."""
VERSION = 3
MINOR_VERSION = 2
DOMAIN = DOMAIN
@property

View File

@ -1,5 +1,7 @@
"""Constants used by the SmartThings component and platforms."""
from pysmartthings import Attribute, Capability
DOMAIN = "smartthings"
SCOPES = [
@ -35,3 +37,75 @@ OLD_DATA = "old_data"
CONF_SUBSCRIPTION_ID = "subscription_id"
EVENT_BUTTON = "smartthings.button"
BINARY_SENSOR_ATTRIBUTES_TO_CAPABILITIES: dict[str, str] = {
Attribute.ACCELERATION: Capability.ACCELERATION_SENSOR,
Attribute.CONTACT: Capability.CONTACT_SENSOR,
Attribute.FILTER_STATUS: Capability.FILTER_STATUS,
Attribute.MOTION: Capability.MOTION_SENSOR,
Attribute.PRESENCE: Capability.PRESENCE_SENSOR,
Attribute.SOUND: Capability.SOUND_SENSOR,
Attribute.TAMPER: Capability.TAMPER_ALERT,
Attribute.VALVE: Capability.VALVE,
Attribute.WATER: Capability.WATER_SENSOR,
}
SENSOR_ATTRIBUTES_TO_CAPABILITIES: dict[str, str] = {
Attribute.LIGHTING_MODE: Capability.ACTIVITY_LIGHTING_MODE,
Attribute.AIR_CONDITIONER_MODE: Capability.AIR_CONDITIONER_MODE,
Attribute.AIR_QUALITY: Capability.AIR_QUALITY_SENSOR,
Attribute.ALARM: Capability.ALARM,
Attribute.BATTERY: Capability.BATTERY,
Attribute.BMI_MEASUREMENT: Capability.BODY_MASS_INDEX_MEASUREMENT,
Attribute.BODY_WEIGHT_MEASUREMENT: Capability.BODY_WEIGHT_MEASUREMENT,
Attribute.CARBON_DIOXIDE: Capability.CARBON_DIOXIDE_MEASUREMENT,
Attribute.CARBON_MONOXIDE: Capability.CARBON_MONOXIDE_MEASUREMENT,
Attribute.CARBON_MONOXIDE_LEVEL: Capability.CARBON_MONOXIDE_MEASUREMENT,
Attribute.DISHWASHER_JOB_STATE: Capability.DISHWASHER_OPERATING_STATE,
Attribute.DRYER_MODE: Capability.DRYER_MODE,
Attribute.DRYER_JOB_STATE: Capability.DRYER_OPERATING_STATE,
Attribute.DUST_LEVEL: Capability.DUST_SENSOR,
Attribute.FINE_DUST_LEVEL: Capability.DUST_SENSOR,
Attribute.ENERGY: Capability.ENERGY_METER,
Attribute.EQUIVALENT_CARBON_DIOXIDE_MEASUREMENT: Capability.EQUIVALENT_CARBON_DIOXIDE_MEASUREMENT,
Attribute.FORMALDEHYDE_LEVEL: Capability.FORMALDEHYDE_MEASUREMENT,
Attribute.GAS_METER: Capability.GAS_METER,
Attribute.GAS_METER_CALORIFIC: Capability.GAS_METER,
Attribute.GAS_METER_TIME: Capability.GAS_METER,
Attribute.GAS_METER_VOLUME: Capability.GAS_METER,
Attribute.ILLUMINANCE: Capability.ILLUMINANCE_MEASUREMENT,
Attribute.INFRARED_LEVEL: Capability.INFRARED_LEVEL,
Attribute.INPUT_SOURCE: Capability.MEDIA_INPUT_SOURCE,
Attribute.PLAYBACK_REPEAT_MODE: Capability.MEDIA_PLAYBACK_REPEAT,
Attribute.PLAYBACK_SHUFFLE: Capability.MEDIA_PLAYBACK_SHUFFLE,
Attribute.PLAYBACK_STATUS: Capability.MEDIA_PLAYBACK,
Attribute.ODOR_LEVEL: Capability.ODOR_SENSOR,
Attribute.OVEN_MODE: Capability.OVEN_MODE,
Attribute.OVEN_JOB_STATE: Capability.OVEN_OPERATING_STATE,
Attribute.OVEN_SETPOINT: Capability.OVEN_SETPOINT,
Attribute.POWER: Capability.POWER_METER,
Attribute.POWER_SOURCE: Capability.POWER_SOURCE,
Attribute.REFRIGERATION_SETPOINT: Capability.REFRIGERATION_SETPOINT,
Attribute.HUMIDITY: Capability.RELATIVE_HUMIDITY_MEASUREMENT,
Attribute.ROBOT_CLEANER_CLEANING_MODE: Capability.ROBOT_CLEANER_CLEANING_MODE,
Attribute.ROBOT_CLEANER_MOVEMENT: Capability.ROBOT_CLEANER_MOVEMENT,
Attribute.ROBOT_CLEANER_TURBO_MODE: Capability.ROBOT_CLEANER_TURBO_MODE,
Attribute.LQI: Capability.SIGNAL_STRENGTH,
Attribute.RSSI: Capability.SIGNAL_STRENGTH,
Attribute.SMOKE: Capability.SMOKE_DETECTOR,
Attribute.TEMPERATURE: Capability.TEMPERATURE_MEASUREMENT,
Attribute.COOLING_SETPOINT: Capability.THERMOSTAT_COOLING_SETPOINT,
Attribute.THERMOSTAT_FAN_MODE: Capability.THERMOSTAT_FAN_MODE,
Attribute.HEATING_SETPOINT: Capability.THERMOSTAT_HEATING_SETPOINT,
Attribute.THERMOSTAT_MODE: Capability.THERMOSTAT_MODE,
Attribute.THERMOSTAT_OPERATING_STATE: Capability.THERMOSTAT_OPERATING_STATE,
Attribute.THERMOSTAT_SETPOINT: Capability.THERMOSTAT_SETPOINT,
Attribute.TV_CHANNEL: Capability.TV_CHANNEL,
Attribute.TV_CHANNEL_NAME: Capability.TV_CHANNEL,
Attribute.TVOC_LEVEL: Capability.TVOC_MEASUREMENT,
Attribute.ULTRAVIOLET_INDEX: Capability.ULTRAVIOLET_INDEX,
Attribute.VERY_FINE_DUST_LEVEL: Capability.VERY_FINE_DUST_SENSOR,
Attribute.VOLTAGE: Capability.VOLTAGE_MEASUREMENT,
Attribute.WASHER_MODE: Capability.WASHER_MODE,
Attribute.WASHER_JOB_STATE: Capability.WASHER_OPERATING_STATE,
}

View File

@ -44,7 +44,7 @@ class SmartThingsEntity(Entity):
if capability in device.status[component]
}
self.device = device
self._attr_unique_id = device.device.device_id
self._attr_unique_id = f"{device.device.device_id}_{component}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, device.device.device_id)},
)

View File

@ -36,9 +36,7 @@ class SmartThingsWasherRinseCyclesNumberEntity(SmartThingsEntity, NumberEntity):
def __init__(self, client: SmartThings, device: FullDevice) -> None:
"""Initialize the instance."""
super().__init__(client, device, {Capability.CUSTOM_WASHER_RINSE_CYCLES})
self._attr_unique_id = (
f"{device.device.device_id}_{MAIN}_{Capability.CUSTOM_WASHER_RINSE_CYCLES}"
)
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{Capability.CUSTOM_WASHER_RINSE_CYCLES}_{Attribute.WASHER_RINSE_CYCLES}_{Attribute.WASHER_RINSE_CYCLES}"
@property
def options(self) -> list[int]:

View File

@ -83,9 +83,7 @@ class SmartThingsSelectEntity(SmartThingsEntity, SelectEntity):
capabilities.add(Capability.REMOTE_CONTROL_STATUS)
super().__init__(client, device, capabilities)
self.entity_description = entity_description
self._attr_unique_id = (
f"{device.device.device_id}_{MAIN}_{entity_description.key}"
)
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{entity_description.key}_{entity_description.status_attribute}_{entity_description.status_attribute}"
@property
def options(self) -> list[str]:

View File

@ -128,7 +128,6 @@ class SmartThingsSensorEntityDescription(SensorEntityDescription):
value_fn: Callable[[Any], str | float | int | datetime | None] = lambda value: value
extra_state_attributes_fn: Callable[[Any], dict[str, Any]] | None = None
unique_id_separator: str = "."
capability_ignore_list: list[set[Capability]] | None = None
options_attribute: Attribute | None = None
exists_fn: Callable[[Status], bool] | None = None
@ -855,21 +854,18 @@ CAPABILITY_TO_SENSORS: dict[
Capability.THREE_AXIS: {
Attribute.THREE_AXIS: [
SmartThingsSensorEntityDescription(
key="X Coordinate",
key="x_coordinate",
translation_key="x_coordinate",
unique_id_separator=" ",
value_fn=lambda value: value[0],
),
SmartThingsSensorEntityDescription(
key="Y Coordinate",
key="y_coordinate",
translation_key="y_coordinate",
unique_id_separator=" ",
value_fn=lambda value: value[1],
),
SmartThingsSensorEntityDescription(
key="Z Coordinate",
key="z_coordinate",
translation_key="z_coordinate",
unique_id_separator=" ",
value_fn=lambda value: value[2],
),
]
@ -1046,7 +1042,7 @@ class SmartThingsSensor(SmartThingsEntity, SensorEntity):
if entity_description.use_temperature_unit:
capabilities_to_subscribe.add(Capability.TEMPERATURE_MEASUREMENT)
super().__init__(client, device, capabilities_to_subscribe)
self._attr_unique_id = f"{device.device.device_id}{entity_description.unique_id_separator}{entity_description.key}"
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{capability}_{attribute}_{entity_description.key}"
self._attribute = attribute
self.capability = capability
self.entity_description = entity_description

View File

@ -123,9 +123,7 @@ class SmartThingsSwitch(SmartThingsEntity, SwitchEntity):
super().__init__(client, device, {capability})
self.entity_description = entity_description
self.switch_capability = capability
self._attr_unique_id = device.device.device_id
if capability is not Capability.SWITCH:
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{capability}"
self._attr_unique_id = f"{device.device.device_id}_{MAIN}_{capability}_{entity_description.status_attribute}_{entity_description.status_attribute}"
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the switch off."""

View File

@ -184,6 +184,7 @@ def mock_config_entry(expires_at: int) -> MockConfigEntry:
CONF_INSTALLED_APP_ID: "123",
},
version=3,
minor_version=2,
)

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd.motion',
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd_main_motionSensor_motion_motion',
'unit_of_measurement': None,
})
# ---
@ -77,7 +77,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd.sound',
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd_main_soundSensor_sound_sound',
'unit_of_measurement': None,
})
# ---
@ -125,7 +125,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '2d9a892b-1c93-45a5-84cb-0e81889498c6.contact',
'unique_id': '2d9a892b-1c93-45a5-84cb-0e81889498c6_main_contactSensor_contact_contact',
'unit_of_measurement': None,
})
# ---
@ -173,7 +173,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a.lockState',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -220,7 +220,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a.doorState',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_samsungce.doorState_doorState_doorState',
'unit_of_measurement': None,
})
# ---
@ -268,7 +268,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a.switch',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -316,7 +316,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a.remoteControlEnabled',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -363,7 +363,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f.lockState',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -410,7 +410,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f.doorState',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_samsungce.doorState_doorState_doorState',
'unit_of_measurement': None,
})
# ---
@ -458,7 +458,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f.remoteControlEnabled',
'unique_id': '9447959a-0dfa-6b27-d40d-650da525c53f_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -505,7 +505,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18.lockState',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -552,7 +552,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'door',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18.doorState',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_samsungce.doorState_doorState_doorState',
'unit_of_measurement': None,
})
# ---
@ -600,7 +600,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18.remoteControlEnabled',
'unique_id': '2c3cbaa0-1899-5ddc-7b58-9d657bd48f18_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -647,7 +647,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'cooler_door',
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_cooler_contactSensor_contact',
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_cooler_contactSensor_contact_contact',
'unit_of_measurement': None,
})
# ---
@ -695,7 +695,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09.contact',
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_main_contactSensor_contact_contact',
'unit_of_measurement': None,
})
# ---
@ -743,7 +743,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'freezer_door',
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_freezer_contactSensor_contact',
'unique_id': '7db87911-7dce-1cf2-7119-b953432a2f09_freezer_contactSensor_contact_contact',
'unit_of_measurement': None,
})
# ---
@ -791,7 +791,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676.lockState',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -838,7 +838,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676.switch',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -886,7 +886,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676.remoteControlEnabled',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -933,7 +933,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b.lockState',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -980,7 +980,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b.switch',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -1028,7 +1028,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b.remoteControlEnabled',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -1075,7 +1075,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'dryer_wrinkle_prevent_active',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b.operatingState',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_custom.dryerWrinklePrevent_operatingState_operatingState',
'unit_of_measurement': None,
})
# ---
@ -1122,7 +1122,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd.lockState',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -1169,7 +1169,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd.switch',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -1217,7 +1217,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd.remoteControlEnabled',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -1264,7 +1264,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'dryer_wrinkle_prevent_active',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd.operatingState',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_custom.dryerWrinklePrevent_operatingState_operatingState',
'unit_of_measurement': None,
})
# ---
@ -1311,7 +1311,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47.lockState',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -1358,7 +1358,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47.switch',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -1406,7 +1406,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47.remoteControlEnabled',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -1453,7 +1453,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'child_lock',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7.lockState',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.kidsLock_lockState_lockState',
'unit_of_measurement': None,
})
# ---
@ -1500,7 +1500,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7.switch',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -1548,7 +1548,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'remote_control',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7.remoteControlEnabled',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_remoteControlStatus_remoteControlEnabled_remoteControlEnabled',
'unit_of_measurement': None,
})
# ---
@ -1595,7 +1595,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'd5dc3299-c266-41c7-bd08-f540aea54b89.motion',
'unique_id': 'd5dc3299-c266-41c7-bd08-f540aea54b89_main_motionSensor_motion_motion',
'unit_of_measurement': None,
})
# ---
@ -1643,7 +1643,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'd5dc3299-c266-41c7-bd08-f540aea54b89.presence',
'unique_id': 'd5dc3299-c266-41c7-bd08-f540aea54b89_main_presenceSensor_presence_presence',
'unit_of_measurement': None,
})
# ---
@ -1691,7 +1691,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '184c67cc-69e2-44b6-8f73-55c963068ad9.presence',
'unique_id': '184c67cc-69e2-44b6-8f73-55c963068ad9_main_presenceSensor_presence_presence',
'unit_of_measurement': None,
})
# ---
@ -1739,7 +1739,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c.contact',
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c_main_contactSensor_contact_contact',
'unit_of_measurement': None,
})
# ---
@ -1787,7 +1787,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'acceleration',
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c.acceleration',
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c_main_accelerationSensor_acceleration_acceleration',
'unit_of_measurement': None,
})
# ---
@ -1835,7 +1835,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'valve',
'unique_id': '612ab3c2-3bb0-48f7-b2c0-15b169cb2fc3.valve',
'unique_id': '612ab3c2-3bb0-48f7-b2c0-15b169cb2fc3_main_valve_valve_valve',
'unit_of_measurement': None,
})
# ---
@ -1883,7 +1883,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'a2a6018b-2663-4727-9d1d-8f56953b5116.water',
'unique_id': 'a2a6018b-2663-4727-9d1d-8f56953b5116_main_waterSensor_water_water',
'unit_of_measurement': None,
})
# ---

View File

@ -36,7 +36,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'bf53a150-f8a4-45d1-aac4-86252475d551',
'unique_id': 'bf53a150-f8a4-45d1-aac4-86252475d551_main',
'unit_of_measurement': None,
})
# ---
@ -99,7 +99,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 387>,
'translation_key': None,
'unique_id': '286ba274-4093-4bcb-849c-a1a3efe7b1e5',
'unique_id': '286ba274-4093-4bcb-849c-a1a3efe7b1e5_main',
'unit_of_measurement': None,
})
# ---
@ -178,7 +178,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 441>,
'translation_key': None,
'unique_id': '96a5ef74-5832-a84b-f1f7-ca799957065d',
'unique_id': '96a5ef74-5832-a84b-f1f7-ca799957065d_main',
'unit_of_measurement': None,
})
# ---
@ -283,7 +283,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 441>,
'translation_key': None,
'unique_id': '4ece486b-89db-f06a-d54d-748b676b4d8e',
'unique_id': '4ece486b-89db-f06a-d54d-748b676b4d8e_main',
'unit_of_measurement': None,
})
# ---
@ -383,7 +383,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'F8042E25-0E53-0000-0000-000000000000',
'unique_id': 'F8042E25-0E53-0000-0000-000000000000_main',
'unit_of_measurement': None,
})
# ---
@ -461,7 +461,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 395>,
'translation_key': None,
'unique_id': '028469cb-6e89-4f14-8d9a-bfbca5e0fbfc',
'unique_id': '028469cb-6e89-4f14-8d9a-bfbca5e0fbfc_main',
'unit_of_measurement': None,
})
# ---
@ -532,7 +532,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 395>,
'translation_key': None,
'unique_id': '1888b38f-6246-4f1e-911b-bfcfb66999db',
'unique_id': '1888b38f-6246-4f1e-911b-bfcfb66999db_main',
'unit_of_measurement': None,
})
# ---
@ -595,7 +595,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 387>,
'translation_key': None,
'unique_id': '656569c2-7976-4232-a789-34b4d1176c3a',
'unique_id': '656569c2-7976-4232-a789-34b4d1176c3a_main',
'unit_of_measurement': None,
})
# ---
@ -657,7 +657,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 387>,
'translation_key': None,
'unique_id': '69a271f6-6537-4982-8cd9-979866872692',
'unique_id': '69a271f6-6537-4982-8cd9-979866872692_main',
'unit_of_measurement': None,
})
# ---
@ -723,7 +723,7 @@
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 395>,
'translation_key': None,
'unique_id': '2894dc93-0f11-49cc-8a81-3a684cebebf6',
'unique_id': '2894dc93-0f11-49cc-8a81-3a684cebebf6_main',
'unit_of_measurement': None,
})
# ---

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': <CoverEntityFeature: 7>,
'translation_key': None,
'unique_id': '571af102-15db-4030-b76b-245a691f74a5',
'unique_id': '571af102-15db-4030-b76b-245a691f74a5_main',
'unit_of_measurement': None,
})
# ---
@ -79,7 +79,7 @@
'previous_unique_id': None,
'supported_features': <CoverEntityFeature: 7>,
'translation_key': None,
'unique_id': '71afed1c-006d-4e48-b16e-e7f88f9fd638',
'unique_id': '71afed1c-006d-4e48-b16e-e7f88f9fd638_main',
'unit_of_measurement': None,
})
# ---

View File

@ -37,7 +37,7 @@
'previous_unique_id': None,
'supported_features': <FanEntityFeature: 57>,
'translation_key': None,
'unique_id': 'f1af21a2-d5a1-437c-b10a-b34a87394b71',
'unique_id': 'f1af21a2-d5a1-437c-b10a-b34a87394b71_main',
'unit_of_measurement': None,
})
# ---
@ -97,7 +97,7 @@
'previous_unique_id': None,
'supported_features': <FanEntityFeature: 49>,
'translation_key': None,
'unique_id': '6d95a8b7-4ee3-429a-a13a-00ec9354170c',
'unique_id': '6d95a8b7-4ee3-429a-a13a-00ec9354170c_main',
'unit_of_measurement': None,
})
# ---

View File

@ -37,7 +37,7 @@
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': '7c16163e-c94e-482f-95f6-139ae0cd9d5e',
'unique_id': '7c16163e-c94e-482f-95f6-139ae0cd9d5e_main',
'unit_of_measurement': None,
})
# ---
@ -103,7 +103,7 @@
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': 'd0268a69-abfb-4c92-a646-61cec2e510ad',
'unique_id': 'd0268a69-abfb-4c92-a646-61cec2e510ad_main',
'unit_of_measurement': None,
})
# ---
@ -160,7 +160,7 @@
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': 'aaedaf28-2ae0-4c1d-b57e-87f6a420c298',
'unique_id': 'aaedaf28-2ae0-4c1d-b57e-87f6a420c298_main',
'unit_of_measurement': None,
})
# ---
@ -221,7 +221,7 @@
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': '440063de-a200-40b5-8a6b-f3399eaa0370',
'unique_id': '440063de-a200-40b5-8a6b-f3399eaa0370_main',
'unit_of_measurement': None,
})
# ---
@ -302,7 +302,7 @@
'previous_unique_id': None,
'supported_features': <LightEntityFeature: 32>,
'translation_key': None,
'unique_id': 'cb958955-b015-498c-9e62-fc0c51abd054',
'unique_id': 'cb958955-b015-498c-9e62-fc0c51abd054_main',
'unit_of_measurement': None,
})
# ---

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'a9f587c5-5d8b-4273-8907-e7f609af5158',
'unique_id': 'a9f587c5-5d8b-4273-8907-e7f609af5158_main',
'unit_of_measurement': None,
})
# ---

View File

@ -37,7 +37,7 @@
'previous_unique_id': None,
'supported_features': <MediaPlayerEntityFeature: 23949>,
'translation_key': None,
'unique_id': 'afcf3b91-0000-1111-2222-ddff2a0a6577',
'unique_id': 'afcf3b91-0000-1111-2222-ddff2a0a6577_main',
'unit_of_measurement': None,
})
# ---
@ -99,7 +99,7 @@
'previous_unique_id': None,
'supported_features': <MediaPlayerEntityFeature: 318477>,
'translation_key': None,
'unique_id': 'c9276e43-fe3c-88c3-1dcc-2eb79e292b8c',
'unique_id': 'c9276e43-fe3c-88c3-1dcc-2eb79e292b8c_main',
'unit_of_measurement': None,
})
# ---
@ -153,7 +153,7 @@
'previous_unique_id': None,
'supported_features': <MediaPlayerEntityFeature: 21517>,
'translation_key': None,
'unique_id': 'c85fced9-c474-4a47-93c2-037cc7829536',
'unique_id': 'c85fced9-c474-4a47-93c2-037cc7829536_main',
'unit_of_measurement': None,
})
# ---
@ -207,7 +207,7 @@
'previous_unique_id': None,
'supported_features': <MediaPlayerEntityFeature: 21901>,
'translation_key': None,
'unique_id': '0d94e5db-8501-2355-eb4f-214163702cac',
'unique_id': '0d94e5db-8501-2355-eb4f-214163702cac_main',
'unit_of_measurement': None,
})
# ---
@ -268,7 +268,7 @@
'previous_unique_id': None,
'supported_features': <MediaPlayerEntityFeature: 23997>,
'translation_key': None,
'unique_id': '4588d2d9-a8cf-40f4-9a0b-ed5dfbaccda1',
'unique_id': '4588d2d9-a8cf-40f4-9a0b-ed5dfbaccda1_main',
'unit_of_measurement': None,
})
# ---

View File

@ -34,7 +34,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'washer_rinse_cycles',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_custom.washerRinseCycles',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_custom.washerRinseCycles_washerRinseCycles_washerRinseCycles',
'unit_of_measurement': 'cycles',
})
# ---
@ -91,7 +91,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'washer_rinse_cycles',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_custom.washerRinseCycles',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_custom.washerRinseCycles_washerRinseCycles_washerRinseCycles',
'unit_of_measurement': 'cycles',
})
# ---

View File

@ -35,7 +35,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'operating_state',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_machineState_machineState',
'unit_of_measurement': None,
})
# ---
@ -93,7 +93,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'operating_state',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_dryerOperatingState',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_dryerOperatingState_machineState_machineState',
'unit_of_measurement': None,
})
# ---
@ -151,7 +151,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'operating_state',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState',
'unit_of_measurement': None,
})
# ---
@ -209,7 +209,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'operating_state',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_washerOperatingState',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_washerOperatingState_machineState_machineState',
'unit_of_measurement': None,
})
# ---

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd',
'unique_id': '10e06a70-ee7d-4832-85e9-a0a06a7a05bd_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -76,7 +76,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a',
'unique_id': '2bad3237-4886-e699-1b90-4a51a3d55c8a_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -123,7 +123,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '3442dfc6-17c0-a65f-dae0-4c6e01786f44',
'unique_id': '3442dfc6-17c0-a65f-dae0-4c6e01786f44_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -170,7 +170,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '1f98ebd0-ac48-d802-7f62-000001200100',
'unique_id': '1f98ebd0-ac48-d802-7f62-000001200100_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -217,7 +217,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676',
'unique_id': 'f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -264,7 +264,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -311,7 +311,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'wrinkle_prevent',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_custom.dryerWrinklePrevent',
'unique_id': '02f7256e-8353-5bdd-547f-bd5b1647e01b_main_custom.dryerWrinklePrevent_dryerWrinklePrevent_dryerWrinklePrevent',
'unit_of_measurement': None,
})
# ---
@ -358,7 +358,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -405,7 +405,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'wrinkle_prevent',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_custom.dryerWrinklePrevent',
'unique_id': '3a6c4e05-811d-5041-e956-3d04c424cbcd_main_custom.dryerWrinklePrevent_dryerWrinklePrevent_dryerWrinklePrevent',
'unit_of_measurement': None,
})
# ---
@ -452,7 +452,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47',
'unique_id': 'f984b91d-f250-9d42-3436-33f09a422a47_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -499,7 +499,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -546,7 +546,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'bubble_soak',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerBubbleSoak',
'unique_id': '63803fae-cbed-f356-a063-2cf148ae3ca7_main_samsungce.washerBubbleSoak_status_status',
'unit_of_measurement': None,
})
# ---
@ -593,7 +593,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '656569c2-7976-4232-a789-34b4d1176c3a',
'unique_id': '656569c2-7976-4232-a789-34b4d1176c3a_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -640,7 +640,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'afcf3b91-0000-1111-2222-ddff2a0a6577',
'unique_id': 'afcf3b91-0000-1111-2222-ddff2a0a6577_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -687,7 +687,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'bf4b1167-48a3-4af7-9186-0900a678ffa5',
'unique_id': 'bf4b1167-48a3-4af7-9186-0900a678ffa5_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -734,7 +734,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '550a1c72-65a0-4d55-b97b-75168e055398',
'unique_id': '550a1c72-65a0-4d55-b97b-75168e055398_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -781,7 +781,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '6602696a-1e48-49e4-919f-69406f5b5da1',
'unique_id': '6602696a-1e48-49e4-919f-69406f5b5da1_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -828,7 +828,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '0d94e5db-8501-2355-eb4f-214163702cac',
'unique_id': '0d94e5db-8501-2355-eb4f-214163702cac_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -875,7 +875,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '5cc1c096-98b9-460c-8f1c-1045509ec605',
'unique_id': '5cc1c096-98b9-460c-8f1c-1045509ec605_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---
@ -922,7 +922,7 @@
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': '4588d2d9-a8cf-40f4-9a0b-ed5dfbaccda1',
'unique_id': '4588d2d9-a8cf-40f4-9a0b-ed5dfbaccda1_main_switch_switch_switch',
'unit_of_measurement': None,
})
# ---

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': '286ba274-4093-4bcb-849c-a1a3efe7b1e5',
'unique_id': '286ba274-4093-4bcb-849c-a1a3efe7b1e5_main',
'unit_of_measurement': None,
})
# ---
@ -89,7 +89,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': 'd0268a69-abfb-4c92-a646-61cec2e510ad',
'unique_id': 'd0268a69-abfb-4c92-a646-61cec2e510ad_main',
'unit_of_measurement': None,
})
# ---
@ -149,7 +149,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': '2d9a892b-1c93-45a5-84cb-0e81889498c6',
'unique_id': '2d9a892b-1c93-45a5-84cb-0e81889498c6_main',
'unit_of_measurement': None,
})
# ---
@ -209,7 +209,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': '71afed1c-006d-4e48-b16e-e7f88f9fd638',
'unique_id': '71afed1c-006d-4e48-b16e-e7f88f9fd638_main',
'unit_of_measurement': None,
})
# ---
@ -269,7 +269,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c',
'unique_id': '7d246592-93db-4d72-a10d-5a51793ece8c_main',
'unit_of_measurement': None,
})
# ---
@ -329,7 +329,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': '550a1c72-65a0-4d55-b97b-75168e055398',
'unique_id': '550a1c72-65a0-4d55-b97b-75168e055398_main',
'unit_of_measurement': None,
})
# ---
@ -389,7 +389,7 @@
'previous_unique_id': None,
'supported_features': <UpdateEntityFeature: 5>,
'translation_key': None,
'unique_id': 'a9f587c5-5d8b-4273-8907-e7f609af5158',
'unique_id': 'a9f587c5-5d8b-4273-8907-e7f609af5158_main',
'unit_of_measurement': None,
})
# ---

View File

@ -29,7 +29,7 @@
'previous_unique_id': None,
'supported_features': <ValveEntityFeature: 3>,
'translation_key': None,
'unique_id': '612ab3c2-3bb0-48f7-b2c0-15b169cb2fc3',
'unique_id': '612ab3c2-3bb0-48f7-b2c0-15b169cb2fc3_main',
'unit_of_measurement': None,
})
# ---

View File

@ -513,7 +513,7 @@ async def test_migration(
}
assert mock_old_config_entry.unique_id == "397678e5-9995-4a39-9d9f-ae6ba310236c"
assert mock_old_config_entry.version == 3
assert mock_old_config_entry.minor_version == 1
assert mock_old_config_entry.minor_version == 2
@pytest.mark.usefixtures("current_request_with_host", "use_cloud")
@ -586,7 +586,7 @@ async def test_migration_wrong_location(
== "appid123-2be1-4e40-b257-e4ef59083324_397678e5-9995-4a39-9d9f-ae6ba310236c"
)
assert mock_old_config_entry.version == 3
assert mock_old_config_entry.minor_version == 1
assert mock_old_config_entry.minor_version == 2
@pytest.mark.usefixtures("current_request_with_host")

View File

@ -15,13 +15,26 @@ from pysmartthings import (
import pytest
from syrupy import SnapshotAssertion
from homeassistant.components.climate import HVACMode
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN, HVACMode
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.components.fan import DOMAIN as FAN_DOMAIN
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.components.lock import DOMAIN as LOCK_DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.smartthings import EVENT_BUTTON
from homeassistant.components.smartthings.const import CONF_SUBSCRIPTION_ID, DOMAIN
from homeassistant.components.smartthings.const import (
CONF_INSTALLED_APP_ID,
CONF_LOCATION_ID,
CONF_SUBSCRIPTION_ID,
DOMAIN,
SCOPES,
)
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import EVENT_HOMEASSISTANT_STOP
from homeassistant.core import Event, HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers import device_registry as dr, entity_registry as er
from . import setup_integration, trigger_update
@ -354,7 +367,6 @@ async def test_deleted_device_runtime(
hass: HomeAssistant,
devices: AsyncMock,
mock_config_entry: MockConfigEntry,
snapshot: SnapshotAssertion,
) -> None:
"""Test devices that are deleted in runtime."""
await setup_integration(hass, mock_config_entry)
@ -367,3 +379,257 @@ async def test_deleted_device_runtime(
await hass.async_block_till_done()
assert hass.states.get("climate.ac_office_granit") is None
@pytest.mark.parametrize(
(
"device_fixture",
"domain",
"old_unique_id",
"suggested_object_id",
"new_unique_id",
),
[
(
"multipurpose_sensor",
BINARY_SENSOR_DOMAIN,
"7d246592-93db-4d72-a10d-5a51793ece8c.contact",
"deck_door",
"7d246592-93db-4d72-a10d-5a51793ece8c_main_contactSensor_contact_contact",
),
(
"multipurpose_sensor",
SENSOR_DOMAIN,
"7d246592-93db-4d72-a10d-5a51793ece8c Y Coordinate",
"deck_door_y_coordinate",
"7d246592-93db-4d72-a10d-5a51793ece8c_main_threeAxis_threeAxis_y_coordinate",
),
(
"da_ac_rac_000001",
SENSOR_DOMAIN,
"7d246592-93db-4d72-a10d-ca799957065d.energy_meter",
"ac_office_granit_energy",
"7d246592-93db-4d72-a10d-ca799957065d_main_powerConsumptionReport_powerConsumption_energy_meter",
),
(
"da_ac_rac_000001",
CLIMATE_DOMAIN,
"7d246592-93db-4d72-a10d-ca799957065d",
"ac_office_granit",
"7d246592-93db-4d72-a10d-ca799957065d_main",
),
(
"c2c_shade",
COVER_DOMAIN,
"571af102-15db-4030-b76b-245a691f74a5",
"curtain_1a",
"571af102-15db-4030-b76b-245a691f74a5_main",
),
(
"generic_fan_3_speed",
FAN_DOMAIN,
"6d95a8b7-4ee3-429a-a13a-00ec9354170c",
"bedroom_fan",
"6d95a8b7-4ee3-429a-a13a-00ec9354170c_main",
),
(
"hue_rgbw_color_bulb",
LIGHT_DOMAIN,
"cb958955-b015-498c-9e62-fc0c51abd054",
"standing_light",
"cb958955-b015-498c-9e62-fc0c51abd054_main",
),
(
"yale_push_button_deadbolt_lock",
LOCK_DOMAIN,
"a9f587c5-5d8b-4273-8907-e7f609af5158",
"basement_door_lock",
"a9f587c5-5d8b-4273-8907-e7f609af5158_main",
),
(
"smart_plug",
SWITCH_DOMAIN,
"550a1c72-65a0-4d55-b97b-75168e055398",
"arlo_beta_basestation",
"550a1c72-65a0-4d55-b97b-75168e055398_main_switch_switch_switch",
),
],
)
async def test_entity_unique_id_migration(
hass: HomeAssistant,
devices: AsyncMock,
expires_at: int,
entity_registry: er.EntityRegistry,
domain: str,
old_unique_id: str,
suggested_object_id: str,
new_unique_id: str,
) -> None:
"""Test entity unique ID migration."""
mock_config_entry = MockConfigEntry(
domain=DOMAIN,
title="My home",
unique_id="397678e5-9995-4a39-9d9f-ae6ba310236c",
data={
"auth_implementation": DOMAIN,
"token": {
"access_token": "mock-access-token",
"refresh_token": "mock-refresh-token",
"expires_at": expires_at,
"scope": " ".join(SCOPES),
"access_tier": 0,
"installed_app_id": "5aaaa925-2be1-4e40-b257-e4ef59083324",
},
CONF_LOCATION_ID: "397678e5-9995-4a39-9d9f-ae6ba310236c",
CONF_INSTALLED_APP_ID: "123",
},
version=3,
minor_version=1,
)
mock_config_entry.add_to_hass(hass)
entry = entity_registry.async_get_or_create(
domain,
DOMAIN,
old_unique_id,
config_entry=mock_config_entry,
suggested_object_id=suggested_object_id,
)
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entry = entity_registry.async_get(entry.entity_id)
assert entry.unique_id == new_unique_id
@pytest.mark.parametrize(
(
"device_fixture",
"domain",
"other_unique_id",
"old_unique_id",
"suggested_object_id",
"new_unique_id",
),
[
(
"da_ks_microwave_0101x",
SENSOR_DOMAIN,
"2bad3237-4886-e699-1b90-4a51a3d55c8a.ovenJobState",
"2bad3237-4886-e699-1b90-4a51a3d55c8a.machineState",
"microwave_machine_state",
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_machineState_machineState",
),
(
"da_ks_microwave_0101x",
SENSOR_DOMAIN,
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_ovenJobState_ovenJobState",
"2bad3237-4886-e699-1b90-4a51a3d55c8a.machineState",
"microwave_machine_state",
"2bad3237-4886-e699-1b90-4a51a3d55c8a_main_ovenOperatingState_machineState_machineState",
),
(
"da_wm_dw_000001",
SENSOR_DOMAIN,
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.dishwasherJobState",
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.machineState",
"microwave_machine_state",
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_machineState_machineState",
),
(
"da_wm_dw_000001",
SENSOR_DOMAIN,
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_dishwasherJobState_dishwasherJobState",
"f36dc7ce-cac0-0667-dc14-a3704eb5e676.machineState",
"microwave_machine_state",
"f36dc7ce-cac0-0667-dc14-a3704eb5e676_main_dishwasherOperatingState_machineState_machineState",
),
(
"da_wm_wd_000001",
SENSOR_DOMAIN,
"02f7256e-8353-5bdd-547f-bd5b1647e01b.dryerJobState",
"02f7256e-8353-5bdd-547f-bd5b1647e01b.machineState",
"dryer_machine_state",
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_machineState_machineState",
),
(
"da_wm_wd_000001",
SENSOR_DOMAIN,
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_dryerJobState_dryerJobState",
"02f7256e-8353-5bdd-547f-bd5b1647e01b.machineState",
"dryer_machine_state",
"02f7256e-8353-5bdd-547f-bd5b1647e01b_main_dryerOperatingState_machineState_machineState",
),
(
"da_wm_wm_000001",
SENSOR_DOMAIN,
"f984b91d-f250-9d42-3436-33f09a422a47.washerJobState",
"f984b91d-f250-9d42-3436-33f09a422a47.machineState",
"washer_machine_state",
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState",
),
(
"da_wm_wm_000001",
SENSOR_DOMAIN,
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_washerJobState_washerJobState",
"f984b91d-f250-9d42-3436-33f09a422a47.machineState",
"washer_machine_state",
"f984b91d-f250-9d42-3436-33f09a422a47_main_washerOperatingState_machineState_machineState",
),
],
)
async def test_entity_unique_id_migration_machine_state(
hass: HomeAssistant,
devices: AsyncMock,
expires_at: int,
entity_registry: er.EntityRegistry,
domain: str,
other_unique_id: str,
old_unique_id: str,
suggested_object_id: str,
new_unique_id: str,
) -> None:
"""Test entity unique ID migration."""
mock_config_entry = MockConfigEntry(
domain=DOMAIN,
title="My home",
unique_id="397678e5-9995-4a39-9d9f-ae6ba310236c",
data={
"auth_implementation": DOMAIN,
"token": {
"access_token": "mock-access-token",
"refresh_token": "mock-refresh-token",
"expires_at": expires_at,
"scope": " ".join(SCOPES),
"access_tier": 0,
"installed_app_id": "5aaaa925-2be1-4e40-b257-e4ef59083324",
},
CONF_LOCATION_ID: "397678e5-9995-4a39-9d9f-ae6ba310236c",
CONF_INSTALLED_APP_ID: "123",
},
version=3,
minor_version=1,
)
mock_config_entry.add_to_hass(hass)
entity_registry.async_get_or_create(
domain,
DOMAIN,
other_unique_id,
config_entry=mock_config_entry,
suggested_object_id="job_state",
)
entry = entity_registry.async_get_or_create(
domain,
DOMAIN,
old_unique_id,
config_entry=mock_config_entry,
suggested_object_id=suggested_object_id,
)
await hass.config_entries.async_setup(mock_config_entry.entry_id)
await hass.async_block_till_done()
entry = entity_registry.async_get(entry.entity_id)
assert entry.unique_id == new_unique_id