Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rfleming71/nestsharp
Simple API for to work with the Nest developer REST API in C#
https://github.com/rfleming71/nestsharp
Last synced: 22 days ago
JSON representation
Simple API for to work with the Nest developer REST API in C#
- Host: GitHub
- URL: https://github.com/rfleming71/nestsharp
- Owner: rfleming71
- Created: 2014-07-15T22:53:11.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-04T17:51:51.000Z (over 8 years ago)
- Last Synced: 2024-10-25T10:03:35.283Z (2 months ago)
- Language: C#
- Homepage:
- Size: 7.1 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NestSharp
=========API for working with the Nest REST API.
Usage
=========
API requires that you create a client on a Nest Developer account before using it. See [Nest Dev Clients]**Build API from a pin**
```C#
string clientId = "clientId";
string clientSecert = "secret";
string pin = "PINPIN";
INestApi nestSharp = await NestSharpBuilder.Authorize(clientSecert, clientId, pin);
```
**Build API from existing AccessToken**
```C#
INestApi nestSharp = NestApiBuilder.WithExistingAccessToken("c.sEmlsiDj9Ssgna0W8MiAQIolv30qguUCv7bXTuUAyReaS30apETDTNGAV2rvkGRuLeUb7o8M9oGBXH7PHShmD9OLS1hqp0FW3JcDlag2WIy0jIPFDo1ArfItpNLIeToQazSG62AOHXhFl6Wt");
```**Setting thermostat target temperature**
```C#
var devices = await nestSharp.GetDeviceInformation();ThermostatRequest request = new ThermostatRequest();
request.DeviceId = devices.Thermostats.First().Value.DeviceId;
request.TemperatureScale = NestSharp.Api.TemperatureScale.Fahrenheit;
request.TargetTemperatureFahrenheit = 76;
await nestSharp.SetThermostat(request);
```**Setting home away temperature**
```C#
var structures = await nestSharp.GetStructureInformation();StructureRequest request = new StructureRequest();
request.StructureId = structures.First().Value.StructureId;
request.Away = AwayState.Away;
await nestSharp.SetStructure(request);
```**Nest developer pages**
[Nest Dev Home]
[Nest Dev Home]:https://developer.nest.com/
[Nest Dev Clients]:https://developer.nest.com/clients