https://github.com/jwinarske/google-smartdevicemanager-rs
Example of using Rust to access the Google Smart Device Manager API.
https://github.com/jwinarske/google-smartdevicemanager-rs
googlesmartdevicemanagement grpc nest rust tonic
Last synced: 3 months ago
JSON representation
Example of using Rust to access the Google Smart Device Manager API.
- Host: GitHub
- URL: https://github.com/jwinarske/google-smartdevicemanager-rs
- Owner: jwinarske
- License: apache-2.0
- Created: 2021-02-07T01:53:24.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-17T15:26:30.000Z (over 5 years ago)
- Last Synced: 2025-07-20T12:24:47.335Z (11 months ago)
- Topics: googlesmartdevicemanagement, grpc, nest, rust, tonic
- Language: Rust
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-Apache2.0
Awesome Lists containing this project
README
# google-smartdevicemanager-rs
Rust code to access the Google Smart Device Management API. This current version uses Tonic. Given the simplicity of the API (for now), protobuf is overkill. Serde and reqwest would be a smaller and more performant combo for a number of reasons. For now it works.
To pull events from the cloud use a crate such as cloud-pubsub.
The Google Smart Device Management API enables Read/Write parameters of:
* Nest Cameras
* Nest Doorbells
* Nest Thermostats
* Google Hub (Display)
It also allows getting events from above devices.
For more details see:
https://developers.google.com/nest/device-access/api
### Pre-requisites
1. Register project: https://developers.google.com/nest/device-access/registration
*Save Project ID to export as variable*
2. Authorize project: https://developers.google.com/nest/device-access/authorize
3. Copy OAuth 2.0 file to local machine
### Required Environmental Variables
This file is used to cache refresh token
export GOOGLE_APPLICATION_TOKEN_STORAGE=$HOME/.secrets/tokenstorage.json
This file is downloaded via https://console.developers.google.com/apis/credentials:
export GOOGLE_APPLICATION_CREDENTIALS=$HOME/.secrets/client_secret_xxx_xxxx.apps.googleusercontent.com.json
This value comes from registering project:
export PROJECT_GUID={project-id}
### Stripped Release Size (Tonic)
-rwxrwxr-x. 1 joel joel 3282272 Feb 7 09:31 google-smartdevicemanager-rs