How to use the pysmartthings.app.AppOAuthEntity function in pysmartthings

To help you get started, we’ve selected a few pysmartthings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github andrewsayre / pysmartthings / tests / test_app.py View on Github external
async def test_refresh(api):
        """Tests the refresh method."""
        # Arrange
        entity = AppOAuthEntity(
            api, 'c6cde2b0-203e-44cf-a510-3b3ed4706996', None)
        # Act
        await entity.refresh()
        # Assert
        assert entity.client_name == 'pysmartthings-test'
        assert 'r:devices' in entity.scope
github andrewsayre / pysmartthings / tests / test_app.py View on Github external
async def test_save(api):
        """Tests the refresh method."""
        # Arrange
        entity = AppOAuthEntity(
            api, 'c6cde2b0-203e-44cf-a510-3b3ed4706996', None)
        entity.client_name = 'pysmartthings-test'
        entity.scope.append('r:devices')
        # Act/Assert
        await entity.save()
github andrewsayre / pysmartthings / pysmartthings / app.py View on Github external
def __init__(self, api: Api, app_id: str, data: Optional[dict]):
        """Init the class."""
        self._client_details = AppOAuthEntity(api, app_id, None)
        super().__init__(data)
github andrewsayre / pysmartthings / pysmartthings / smartthings.py View on Github external
async def update_app_oauth(self, data: AppOAuth) -> AppOAuthEntity:
        """Update an app's OAuth settings without having to retrieve it."""
        entity = await self._service.update_app_oauth(data.app_id, data.to_data())
        return AppOAuthEntity(self._service, data.app_id, entity)
github andrewsayre / pysmartthings / pysmartthings / app.py View on Github external
async def oauth(self) -> AppOAuthEntity:
        """Get the app's OAuth settings."""
        entity = await self._api.get_app_oauth(self._app_id)
        return AppOAuthEntity(self._api, self._app_id, entity)
github andrewsayre / pysmartthings / pysmartthings / smartthings.py View on Github external
async def app_oauth(self, app_id: str) -> AppOAuthEntity:
        """Get an app's OAuth settings."""
        oauth = await self._service.get_app_oauth(app_id)
        return AppOAuthEntity(self._service, app_id, oauth)