Adds Tesla API integration
All checks were successful
Build, Push and Run Container / build (push) Successful in 25s

Adds an endpoint to interact with the Tesla API via a command proxy.

This includes fetching vehicle information and configuring telemetry settings. It introduces new models to represent the Tesla API responses and request structures.
This commit is contained in:
2025-08-17 12:03:26 +02:00
parent 663bb4b019
commit f049d023c9
4 changed files with 195 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
namespace ProofOfConcept.Models;
using System.Text.Json.Serialization;
public sealed class VehiclesEnvelope
{
[JsonPropertyName("response")]
public List<VehicleSummary> Response { get; set; } = new();
[JsonPropertyName("count")]
public int Count { get; set; }
}
public sealed class VehicleSummary
{
// Tesla fields commonly present on /api/1/vehicles
[JsonPropertyName("id")] public long Id { get; set; }
[JsonPropertyName("vehicle_id")] public long VehicleId { get; set; }
[JsonPropertyName("vin")] public string? Vin { get; set; }
[JsonPropertyName("display_name")] public string? DisplayName { get; set; }
[JsonPropertyName("state")] public string? State { get; set; }
// Extra fields sometimes included; safe to keep nullable
[JsonPropertyName("in_service")] public bool? InService { get; set; }
[JsonPropertyName("calendar_enabled")] public bool? CalendarEnabled { get; set; }
[JsonPropertyName("id_s")] public string? IdS { get; set; }
[JsonPropertyName("option_codes")] public string? OptionCodes { get; set; }
[JsonPropertyName("color")] public string? Color { get; set; }
}