mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Fix scope comparison in SmartThings (#139652)
This commit is contained in:
parent
ad04b53615
commit
03cb177e7c
@ -34,7 +34,7 @@ class SmartThingsConfigFlow(AbstractOAuth2FlowHandler, domain=DOMAIN):
|
||||
|
||||
async def async_oauth_create_entry(self, data: dict[str, Any]) -> ConfigFlowResult:
|
||||
"""Create an entry for SmartThings."""
|
||||
if data[CONF_TOKEN]["scope"].split() != SCOPES:
|
||||
if not set(data[CONF_TOKEN]["scope"].split()) >= set(SCOPES):
|
||||
return self.async_abort(reason="missing_scopes")
|
||||
client = SmartThings(session=async_get_clientsession(self.hass))
|
||||
client.authenticate(data[CONF_TOKEN][CONF_ACCESS_TOKEN])
|
||||
|
@ -261,7 +261,7 @@ async def test_reauthentication(
|
||||
"expires_in": 82806,
|
||||
"scope": "r:devices:* w:devices:* x:devices:* r:hubs:* "
|
||||
"r:locations:* w:locations:* x:locations:* "
|
||||
"r:scenes:* x:scenes:* r:rules:* w:rules:* sse",
|
||||
"r:scenes:* x:scenes:* r:rules:* sse w:rules:*",
|
||||
"access_tier": 0,
|
||||
"installed_app_id": "5aaaa925-2be1-4e40-b257-e4ef59083324",
|
||||
},
|
||||
@ -279,7 +279,7 @@ async def test_reauthentication(
|
||||
"expires_in": 82806,
|
||||
"scope": "r:devices:* w:devices:* x:devices:* r:hubs:* "
|
||||
"r:locations:* w:locations:* x:locations:* "
|
||||
"r:scenes:* x:scenes:* r:rules:* w:rules:* sse",
|
||||
"r:scenes:* x:scenes:* r:rules:* sse w:rules:*",
|
||||
"access_tier": 0,
|
||||
"installed_app_id": "5aaaa925-2be1-4e40-b257-e4ef59083324",
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user