Skip to content

A simple httpclient implementation of the Tesla Gateway 2 api

License

Notifications You must be signed in to change notification settings

benjiro/GatewayClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GatewayClient

A simple httpclient implementation of the Tesla Gateway 2 api. Based off the work Vince Loschiavo(@vloschiavo) did over at https://github.com/vloschiavo/powerwall2

Install

dotnet add package GatewayClient

Usage

ASP.NET Core

.ConfigureServices((context, services) =>
            {
                services
                    .AddHttpClient("GatewayClient", client =>
                    {
                        client.BaseAddress = new Uri("https://localhost"); // Base url for gateway web uri
                        client.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-GatewayClient");
                    })
                    .ConfigurePrimaryHttpMessageHandler(() => new HttpClientHandler
                    {
                        ServerCertificateCustomValidationCallback = (message, certificate2, arg3, arg4) => true // Ignore self signed cert
                    })
                    .AddTypedClient<GatewayClient>();
            });

About

A simple httpclient implementation of the Tesla Gateway 2 api

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages