google-nest-sdm


Namegoogle-nest-sdm JSON
Version 3.0.3 PyPI version JSON
download
home_pagehttps://github.com/allenporter/python-google-nest-sdm
SummaryLibrary for the Google Nest SDM API
upload_time2023-10-29 21:06:16
maintainer
docs_urlNone
authorAllen Porter
requires_python>=3.10
license
keywords google nest sdm camera therostat security doorbell
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # python-google-nest-sdm

This is a library for Google Nest [Device Access](https://developers.google.com/nest/device-access)
using the [Smart Device Management API](https://developers.google.com/nest/device-access/api).

# Usage

This can be used with the sandbox which requires [Registration](https://developers.google.com/nest/device-access/registration), accepting terms
and a fee.

You'll want to following the [Get Started](https://developers.google.com/nest/device-access/get-started)
guides for setup including steps in the google cloud console.  Overall, this is
fairly complicated with many steps that are easy to get wrong.  It is likely
worth it to make sure you can get the API working using their supplied curl
commands with your account before attempting to use this library.

# Structure

This API was designed for use in Home Assistant following the advice in
[Building a Python Library for an API](https://developers.home-assistant.io/docs/api_lib_index/).

If you are integrating this from outside Home Assistant, you'll need to
create your own oauth integration and token refresh mechanism and tooling.

# Fetching Data

This is an example to use the command line tool to access the API:

```
PROJECT_ID="some-project-id"
CLIENT_ID="some-client-id"
CLIENT_SECRET="some-client-secret"
# Initial call will ask you to authorize OAuth2 then cache the token
google_nest --project_id="${PROJECT_ID}" --client_id="${CLIENT_ID}" --client_secret="${CLIENT_SECRET}" list_structures
# Subsequent calls only need the project id
google_nest --project_id="${PROJECT_ID}" get_device "some-device-id"
google_nest --project_id="${PROJECT_ID}" set_mode COOL
google_nest --project_id="${PROJECT_ID}" set_cool 25.0
```

# Subscriptions

See [Device Access: Getting Started: Subscribe to Events](https://developers.google.com/nest/device-access/subscribe-to-events)
for documentation on how to create a pull subscription.

You can create the subscription to use with the tool with these steps:

* Create the topic:
  * Visit the [Device Access Console](https://console.nest.google.com/device-access)
  * Select a project
  * Enable Pub/Sub and note the full `topic` based on the `project_id`
* Create the subscriber:
  * Visit [Google Cloud Platform: Pub/Sub: Subscriptions](https://console.cloud.google.com/cloudpubsub/subscriptions)
  * Create a subscriber
  * Enter the `Topic Name`
  * Create a `Subscription Name`, e.g. "project-id-python" which is your `subscriber_id`

This is an example to run the command line tool to subscribe:
```
PROJECT_ID="some-project-id"
SUBSCRIPTION_ID="projects/some-id/subscriptions/enterprise-some-project-id-python-google-nest"
google_nest --project_id="${PROJECT_ID}" subscribe ${SUBSCRIPTION_ID}
```

# Development

```
$ python3 -m venv venv
$ source venv/bin/activate
$ pip3 install -e .
$ pip3 install -r requirements.txt

# Running tests
$ pytest

# Running tests w/ Code Coverage
$ pytest --cov=google_nest_sdm tests/ --cov-report=term-missing

# Formatting and linting
$ pre-commit run --all-files
```

# Funding and Support

If you are interested in donating money to this effort, instead send a
donation to [Black Girls Code](https://donorbox.org/support-black-girls-code)
which is a great organization growing the next generation of software engineers.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/allenporter/python-google-nest-sdm",
    "name": "google-nest-sdm",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": "",
    "keywords": "google nest sdm camera therostat security doorbell",
    "author": "Allen Porter",
    "author_email": "allen@thebends.org",
    "download_url": "https://files.pythonhosted.org/packages/2f/ee/5193de7f5d955acae3b6012c62ede7710ecf8eba5834ba9a6c5f71c7b702/google_nest_sdm-3.0.3.tar.gz",
    "platform": null,
    "description": "# python-google-nest-sdm\n\nThis is a library for Google Nest [Device Access](https://developers.google.com/nest/device-access)\nusing the [Smart Device Management API](https://developers.google.com/nest/device-access/api).\n\n# Usage\n\nThis can be used with the sandbox which requires [Registration](https://developers.google.com/nest/device-access/registration), accepting terms\nand a fee.\n\nYou'll want to following the [Get Started](https://developers.google.com/nest/device-access/get-started)\nguides for setup including steps in the google cloud console.  Overall, this is\nfairly complicated with many steps that are easy to get wrong.  It is likely\nworth it to make sure you can get the API working using their supplied curl\ncommands with your account before attempting to use this library.\n\n# Structure\n\nThis API was designed for use in Home Assistant following the advice in\n[Building a Python Library for an API](https://developers.home-assistant.io/docs/api_lib_index/).\n\nIf you are integrating this from outside Home Assistant, you'll need to\ncreate your own oauth integration and token refresh mechanism and tooling.\n\n# Fetching Data\n\nThis is an example to use the command line tool to access the API:\n\n```\nPROJECT_ID=\"some-project-id\"\nCLIENT_ID=\"some-client-id\"\nCLIENT_SECRET=\"some-client-secret\"\n# Initial call will ask you to authorize OAuth2 then cache the token\ngoogle_nest --project_id=\"${PROJECT_ID}\" --client_id=\"${CLIENT_ID}\" --client_secret=\"${CLIENT_SECRET}\" list_structures\n# Subsequent calls only need the project id\ngoogle_nest --project_id=\"${PROJECT_ID}\" get_device \"some-device-id\"\ngoogle_nest --project_id=\"${PROJECT_ID}\" set_mode COOL\ngoogle_nest --project_id=\"${PROJECT_ID}\" set_cool 25.0\n```\n\n# Subscriptions\n\nSee [Device Access: Getting Started: Subscribe to Events](https://developers.google.com/nest/device-access/subscribe-to-events)\nfor documentation on how to create a pull subscription.\n\nYou can create the subscription to use with the tool with these steps:\n\n* Create the topic:\n  * Visit the [Device Access Console](https://console.nest.google.com/device-access)\n  * Select a project\n  * Enable Pub/Sub and note the full `topic` based on the `project_id`\n* Create the subscriber:\n  * Visit [Google Cloud Platform: Pub/Sub: Subscriptions](https://console.cloud.google.com/cloudpubsub/subscriptions)\n  * Create a subscriber\n  * Enter the `Topic Name`\n  * Create a `Subscription Name`, e.g. \"project-id-python\" which is your `subscriber_id`\n\nThis is an example to run the command line tool to subscribe:\n```\nPROJECT_ID=\"some-project-id\"\nSUBSCRIPTION_ID=\"projects/some-id/subscriptions/enterprise-some-project-id-python-google-nest\"\ngoogle_nest --project_id=\"${PROJECT_ID}\" subscribe ${SUBSCRIPTION_ID}\n```\n\n# Development\n\n```\n$ python3 -m venv venv\n$ source venv/bin/activate\n$ pip3 install -e .\n$ pip3 install -r requirements.txt\n\n# Running tests\n$ pytest\n\n# Running tests w/ Code Coverage\n$ pytest --cov=google_nest_sdm tests/ --cov-report=term-missing\n\n# Formatting and linting\n$ pre-commit run --all-files\n```\n\n# Funding and Support\n\nIf you are interested in donating money to this effort, instead send a\ndonation to [Black Girls Code](https://donorbox.org/support-black-girls-code)\nwhich is a great organization growing the next generation of software engineers.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Library for the Google Nest SDM API",
    "version": "3.0.3",
    "project_urls": {
        "Homepage": "https://github.com/allenporter/python-google-nest-sdm"
    },
    "split_keywords": [
        "google",
        "nest",
        "sdm",
        "camera",
        "therostat",
        "security",
        "doorbell"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d17bc18059ff20fa9c94735989607056ac9996b5545c90a5e369f931c6c244dd",
                "md5": "afe766393a0d905f54bb41a37c17c755",
                "sha256": "2ee6794ff16ef391704882eaa929806cbea72557a40e4f2515cb53524d1e6072"
            },
            "downloads": -1,
            "filename": "google_nest_sdm-3.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "afe766393a0d905f54bb41a37c17c755",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 44502,
            "upload_time": "2023-10-29T21:06:14",
            "upload_time_iso_8601": "2023-10-29T21:06:14.202566Z",
            "url": "https://files.pythonhosted.org/packages/d1/7b/c18059ff20fa9c94735989607056ac9996b5545c90a5e369f931c6c244dd/google_nest_sdm-3.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2fee5193de7f5d955acae3b6012c62ede7710ecf8eba5834ba9a6c5f71c7b702",
                "md5": "f398e7bbfcfedcbb919640fb250f8be7",
                "sha256": "b6df4c7edf79135969d5febfc901c2b10344527075a6436970cf36243ea65998"
            },
            "downloads": -1,
            "filename": "google_nest_sdm-3.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "f398e7bbfcfedcbb919640fb250f8be7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 57090,
            "upload_time": "2023-10-29T21:06:16",
            "upload_time_iso_8601": "2023-10-29T21:06:16.411462Z",
            "url": "https://files.pythonhosted.org/packages/2f/ee/5193de7f5d955acae3b6012c62ede7710ecf8eba5834ba9a6c5f71c7b702/google_nest_sdm-3.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-29 21:06:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "allenporter",
    "github_project": "python-google-nest-sdm",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "google-nest-sdm"
}
        
Elapsed time: 0.15478s