Return if user is local only (#60917)

This commit is contained in:
Bram Kragten 2021-12-03 16:34:26 +01:00 committed by GitHub
parent b883014ed4
commit ef458b237c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -150,6 +150,7 @@ def _user_info(user):
"name": user.name,
"is_owner": user.is_owner,
"is_active": user.is_active,
"local_only": user.local_only,
"system_generated": user.system_generated,
"group_ids": [group.id for group in user.groups],
"credentials": [{"type": c.auth_provider_type} for c in user.credentials],

View File

@ -66,6 +66,7 @@ async def test_list(hass, hass_ws_client, hass_admin_user):
"name": "Mock User",
"is_owner": False,
"is_active": True,
"local_only": False,
"system_generated": False,
"group_ids": [group.id for group in hass_admin_user.groups],
"credentials": [{"type": "homeassistant"}],
@ -76,6 +77,7 @@ async def test_list(hass, hass_ws_client, hass_admin_user):
"name": "Test Owner",
"is_owner": True,
"is_active": True,
"local_only": False,
"system_generated": False,
"group_ids": [group.id for group in owner.groups],
"credentials": [{"type": "homeassistant"}],
@ -86,6 +88,7 @@ async def test_list(hass, hass_ws_client, hass_admin_user):
"name": "Test Hass.io",
"is_owner": False,
"is_active": True,
"local_only": False,
"system_generated": True,
"group_ids": [],
"credentials": [],
@ -96,6 +99,7 @@ async def test_list(hass, hass_ws_client, hass_admin_user):
"name": "Inactive User",
"is_owner": False,
"is_active": False,
"local_only": False,
"system_generated": False,
"group_ids": [group.id for group in inactive.groups],
"credentials": [],