diff --git a/homeassistant/components/person/__init__.py b/homeassistant/components/person/__init__.py index fcf3bee45b9..c34fb89a718 100644 --- a/homeassistant/components/person/__init__.py +++ b/homeassistant/components/person/__init__.py @@ -214,7 +214,7 @@ class PersonStorageCollection(collection.StorageCollection): user_id = update_data.get(CONF_USER_ID) - if user_id is not None: + if user_id is not None and user_id != data.get(CONF_USER_ID): await self._validate_user_id(user_id) return {**data, **update_data} diff --git a/tests/components/person/test_init.py b/tests/components/person/test_init.py index 5eaec6d5bf1..699fb58a539 100644 --- a/tests/components/person/test_init.py +++ b/tests/components/person/test_init.py @@ -514,6 +514,18 @@ async def test_ws_update(hass, hass_ws_client, storage_setup): "id": 6, "type": "person/update", "person_id": persons[0]["id"], + "user_id": persons[0]["user_id"], + } + ) + resp = await client.receive_json() + + assert resp["success"] + + resp = await client.send_json( + { + "id": 7, + "type": "person/update", + "person_id": persons[0]["id"], "name": "Updated Name", "device_trackers": [DEVICE_TRACKER_2], "user_id": None,