Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SmartThings Scene platform #21405

Merged
merged 3 commits into from Feb 26, 2019

Conversation

andrewsayre
Copy link
Member

Description:

Adds the SmartThings Scene platform which allows execution of scenes defined within SmartThings. A scene entity is created for each scene as defined in SmartThings

Pull request in home-assistant.io with documentation: home-assistant/home-assistant.io#8718

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@andrewsayre
Copy link
Member Author

andrewsayre commented Feb 25, 2019

This PR will need to be rebased to fix new tests added by recently merged PRs. I'll get that done tonight.

@andrewsayre
Copy link
Member Author

This PR will need to be rebased to fix new tests added by recently merged PRs. I'll get that done tonight.

Ready for review!

return await api.scenes(location_id=entry.data[CONF_LOCATION_ID])
except ClientResponseError as ex:
if ex.status == 403:
_LOGGER.exception("Unable to load scenes for config entry '%s' "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you don't want to act on an invalid token? Should we notify the user via a persistent_notification ? Should we trigger a new config flow to request the new scope?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a valid token, just missing an OAuth scope. I didn’t think it needed to be an error for the whole integration or something we wanted to pester the user about. This could be a way to “turn off scenes” in the integration.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future I’ll mske the device scope optional too, so someone could only care about scenes.

@balloob balloob merged commit 3b9db88 into home-assistant:dev Feb 26, 2019
@ghost ghost removed the in progress label Feb 26, 2019
@andrewsayre andrewsayre deleted the feature-smartthings-scene branch February 27, 2019 03:26
@balloob balloob mentioned this pull request Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants