Exemple #1
0
        public async Task <NetatmoOAuth> GetNetatmoOAuthAsync()
        {
            var body = new Dictionary <string, string>
            {
                { "grant_type", "password" },
                { "client_id", Options.Value.Netatmo.ClientId },
                { "client_secret", Options.Value.Netatmo.ClientSecret },
                { "username", Options.Value.Netatmo.UserName },
                { "password", Options.Value.Netatmo.Password }
            };

            var token = await m_HttpWrapper.PostFormUrlEncodedAsync <NetatmoOAuth>(body, UrlBuilder.Netatmo.BuildOauthTokenUrl());

            Token = token;
            return(token);
        }