2017 © Pedro Peláez
 

library nest-api

PHP Nest API client

image

laulamanapps/nest-api

PHP Nest API client

  • Tuesday, July 3, 2018
  • by LauLaman
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Nest Api

This package provides a simple integration of the Official Nest Api for your PHP project., (*1)

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version License, (*2)

Installation

With composer, add:, (*3)

$ composer require laulamanapps/nest-api

if you want to make use of the provided Guzzle adapter, require guzzlehttp in your composer:, (*4)

$ composer require guzzlehttp/guzzle

Get Access Token

Sign up at Nest as a Developer and get yourself an ClientID and ClientSecret, (*5)

Run the get-oauth-token in the terminal and follow the instructions, (*6)

$ ./bin/get-oauth-token

Usage

use LauLamanApps\NestApi\NestClientFactory;
use LauLamanApps\NestApi\Client\Device\Thermostat\Temperature;

$client = NestClientFactory::create('<AccessToken>');

$thermostat = $client->getThermostat('<DeviceId>');

// Get current Temperature
echo 'The current temperature is:';
echo $thermostat->getAmbientTemperature();

// Set Target Temperature
$newTemperature = Temperature::celsius(21.5);
$thermostat->setTargetTemperature($newTemperature);

Tests

This package comes with 2 types of tests: Unit and Integration. To run them you can use the make commands in the projects root., (*7)

$ make tests # Runs all tests
$ make tests-unit # Runs only unit tests
$ make tests-integration # Runs only integration tests

Author

Nest API has been developed by LauLaman., (*8)

The Versions

03/07 2018

dev-master

9999999-dev

PHP Nest API client

  Sources   Download

MIT

The Requires

 

The Development Requires