This package provides Netatmo OAuth 2.0 support for the PHP League's OAuth 2.0 Client.
To install, use composer:
composer require rugaard/oauth2-netatmo
Usage is the same as The League's OAuth client, using \Rugaard\OAuth2\Client\Netatmo\Provider\Netatmo
as the provider.
$provider = new \Rugaard\OAuth2\Client\Netatmo\Provider\Netatmo([
'clientId' => '{netatmo-client-id}',
'clientSecret' => '{netatmo-client-secret}',
'redirectUri' => 'https://example.com/callback-url'
]);
// Authorize with default scopes.
$url = $provider->getAuthorizationUrl();
// Authorize with other scopes.
$url = $provider->getAuthorizationUrl([
'scope' => ['read_scope', 'write_scope']
]);
To see which scopes are available, please refer to the scopes section.
For further usage of this package please refer to the core package documentation on "Authorization Code Grant".
Note: This provider will always request the read_thermostat
scope during authorization. Without this scope, Netatmo does not provide a generic way to fetch information about the "resource owner".
Weather Station
read_station
Thermostat
read_thermostat
write_thermostat
Home Coach
read_homecoach
Welcome
read_camera
write_camera
access_camera
(requires app to have granted scope by Netatmo)
Presence
access_presence
(requires app to have granted scope by Netatmo)
Smoke Alarm
read_smokedetector
$ ./vendor/bin/phpunit
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.