Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #1742

Open
wants to merge 91 commits into
base: master
Choose a base branch
from
Open

Develop #1742

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
76045c9
feat(backendApiService): can refresh tokens
pkuehnel Dec 26, 2024
ba4e0fb
fic(chore): compiler errors
pkuehnel Dec 26, 2024
0ca3bc1
feat(TeslaFleetApiService): get cars from account via Solar4CarBackend
pkuehnel Dec 26, 2024
676a1d3
feat(chore): create Backend user on fleet api token generation
pkuehnel Dec 27, 2024
7d636eb
feat(EF): replace tesla tokens with backend tokens
pkuehnel Dec 27, 2024
d64ddbc
feat(chore): refactor login
pkuehnel Dec 28, 2024
70223f3
feat(CreateBackendTokenDialog): Hide password chars
pkuehnel Dec 28, 2024
288d3e7
fix(CreateBackendTokenDialog): remove unnecessary code
pkuehnel Dec 28, 2024
6fbd8c5
fix(BackendApiService): use correct header
pkuehnel Dec 28, 2024
e609859
fix(BackendApiService): save new token on refresh receive
pkuehnel Dec 29, 2024
af0d7aa
feat(BackendApiService): refresh backend token only if needed
pkuehnel Dec 29, 2024
7e4fd60
feat(ErrorHandlingService): can display correct error messages on tok…
pkuehnel Dec 29, 2024
6c1d7a4
feat(TeslaFleetApiService): can use new backend
pkuehnel Dec 30, 2024
692bd3f
feat(TeslaFleetApiTokenHelper): can handle additional token states
pkuehnel Dec 30, 2024
1275ef5
fix(chore): various token encryption related issues
pkuehnel Dec 30, 2024
50339bb
fix(Constants): update fleet api request urls
pkuehnel Dec 30, 2024
b30d408
refactor(Constants): remove unnecessary properties
pkuehnel Dec 30, 2024
cf2fec4
refactor(BackendApiController): convert value to DtoValue in controller
pkuehnel Dec 30, 2024
a428d2b
feat(TeslaFleetApiTokenHelper): Split token issue detection in two me…
pkuehnel Dec 30, 2024
da9546f
refactor(TokenHelper): use memory cache for some token values
pkuehnel Dec 30, 2024
8df29f9
feat(BackendApiService): invalidate backend token memory cache state
pkuehnel Dec 30, 2024
682f06c
feat(TeslaFleetApiService): can refresh fleet api token
pkuehnel Dec 30, 2024
42e0bb5
feat(CarValueType): add Car name as car value type
pkuehnel Dec 31, 2024
fbaf6ca
fix(BackendApiService): set new ExpiresAtUtc on token refresh
pkuehnel Dec 31, 2024
997ee64
fix(FleetTelemetryWebSocketService): update url
pkuehnel Dec 31, 2024
4e51715
feat(PossibleIssues): show backend api isssues after first occurrence
pkuehnel Jan 1, 2025
11833e5
fix(PossibleIssues): add missing issue
pkuehnel Jan 1, 2025
05bb658
feat(BackendApiService): send installation info to new endpoint
pkuehnel Jan 5, 2025
9fda99f
feat(BackendApiService): use separateEndpoint for no token installati…
pkuehnel Jan 5, 2025
9a4fcb3
fix(PossibleIssues): MakeSolar4CarSideFleetApiStatusCode HasPlaceholder
pkuehnel Jan 5, 2025
61bf3ea
refactor(BackendApiService): add generic method for backend requests
pkuehnel Jan 6, 2025
ff4bba2
refactor(BackendApiService): use separate method for backend communic…
pkuehnel Jan 6, 2025
5189b7f
refactor(TeslaFleetApiService): use backendApiService to send requests
pkuehnel Jan 6, 2025
d245fdb
feat(BackendConnectionRazor): display current token state
pkuehnel Jan 6, 2025
13aeb06
feat(IndexRazor): replace www.teslasolarcharger.de key with solar4car…
pkuehnel Jan 6, 2025
94c4e52
fix(TeslaFleetApiService): handle error responses correctly
pkuehnel Jan 6, 2025
a63bdbf
fix(TeslaFleetApiService): handle non success tesla api status codes …
pkuehnel Jan 6, 2025
1f4d328
fix(BackendApiService): remove fleet api token errors on requesting n…
pkuehnel Jan 7, 2025
2b12e6b
fix(TokenHelper): check for existance of value as true
pkuehnel Jan 7, 2025
c93f45b
fix(TeslaFleetApiService): set missing scopes key to true or false
pkuehnel Jan 7, 2025
b4da7ad
fix(LoggedErrorsComponent): use correct parameter for initially expanded
pkuehnel Jan 7, 2025
5e46065
WIP
pkuehnel Jan 10, 2025
9de3487
WIP
pkuehnel Jan 11, 2025
60097bc
feat(ApiExcpetionFilterAttribute): working exception handling in the …
pkuehnel Jan 11, 2025
f28bde8
feat(ServerSideValidation): working with VAlidationProblemDetails
pkuehnel Jan 11, 2025
935d847
feat(CarSettingsRazor): can validate async methods
pkuehnel Jan 11, 2025
606a22c
feat(CarBasicConfigurationValidator): only allow enabling fleet telem…
pkuehnel Jan 11, 2025
3c616ae
feat(CarSettingsRazor): improve UI
pkuehnel Jan 11, 2025
39b075f
feat(BackendApiService): rename error as instead of backend cloud is …
pkuehnel Jan 11, 2025
2a4d797
feat(CarSettings): further improve car settings UI
pkuehnel Jan 11, 2025
24968a6
feat(CarBasicConfiguration): add info for required car license
pkuehnel Jan 13, 2025
e5f5e3b
fix(BackendApiService): fix url generation for Notify installation
pkuehnel Jan 13, 2025
798bc90
feat(CarBasicConfigurationValidator): do not allow enableing Fleet te…
pkuehnel Jan 13, 2025
c7c5227
feat(CarSettings): only update IncludeTracking fields on disabling fl…
pkuehnel Jan 13, 2025
9a8887e
fix(Car): rename column to match Dto
pkuehnel Jan 13, 2025
7183111
refactor(FleetTelemetryWebSocketService): rename variable names
pkuehnel Jan 13, 2025
bd5a6f4
refactor(chore): remove Automapper to prevent runtime errors
pkuehnel Jan 13, 2025
6d954e7
feat(EF): Add migration to use VAlueConverterForDateLists
pkuehnel Jan 13, 2025
f946174
fix(ErrorHandlingService): only add acutally hidden errors to hidden …
pkuehnel Jan 13, 2025
0150cf1
feat(TeslaFleetApiService): do not call Fleet API if Fleet Telemetry …
pkuehnel Jan 14, 2025
098b0dc
feat(TeslaFleetApiService): only refresh vehicle online state if needed
pkuehnel Jan 14, 2025
5284621
feat(Program): log soc limit
pkuehnel Jan 15, 2025
e6258eb
fix(FleetTelemetryWebSocketService): set charger phases correctly
pkuehnel Jan 15, 2025
6dc0c4f
Revert "feat(Program): log soc limit"
pkuehnel Jan 15, 2025
04fc56c
fix(BackendApiService): auto resolve all backend api token errors aft…
pkuehnel Jan 15, 2025
efb9096
feat(BackendApiService): can detect if app is licensed
pkuehnel Jan 15, 2025
7a7d67b
feat(BackendApiService): use memory cache for licenses
pkuehnel Jan 16, 2025
a9ec1d7
feat(TeslaFleetApiService): check if Fleet Telemetry is configured in…
pkuehnel Jan 16, 2025
17f7e40
feat(TeslaFleetApiService): check licenses
pkuehnel Jan 16, 2025
59804b9
Merge pull request #1703 from pkuehnel/feat/useCloudTeslaTokens
pkuehnel Jan 16, 2025
37d7868
fix(TeslaFleetApiService): only block non fleet Api compatible comman…
pkuehnel Jan 16, 2025
fc4bb26
Merge pull request #1745 from pkuehnel/fix/bleCommandsOnFleetApi
pkuehnel Jan 16, 2025
fa9f17b
fix(TeslaFleetApiService): do not show not licenses error on Fleet BLE
pkuehnel Jan 17, 2025
2698a24
Merge pull request #1750 from pkuehnel/fix/noFleetApiLicenseErrorOnBl…
pkuehnel Jan 17, 2025
ce653a4
feat(CarValueType): log isonline
pkuehnel Jan 17, 2025
ce6323b
fix(FleetTelemetryWebSocketService): use asleepOrOffline for connecti…
pkuehnel Jan 17, 2025
53bbc14
Merge pull request #1752 from pkuehnel/feat/logIsOnlineFromFleetTelem…
pkuehnel Jan 18, 2025
2153530
feat(CloudConnectionRazor): improve UI for backend and fleet api token
pkuehnel Jan 18, 2025
65be498
feat(ErrorHandlingService): update links instead of base config to cl…
pkuehnel Jan 18, 2025
eb67a57
Merge pull request #1754 from pkuehnel/feat/improveCloudConnectUi
pkuehnel Jan 18, 2025
4389cd9
feat(BackendApiService): memory cache entries on backend login
pkuehnel Jan 18, 2025
7bb95ce
Merge pull request #1755 from pkuehnel/feat/clearMemoryCacheEntriesOn…
pkuehnel Jan 18, 2025
fee8c06
feat(FleetTelemetryWebSocketService): only update DtoCar values if te…
pkuehnel Jan 18, 2025
59cdb8b
feat(Tests): add OnlySetsNewerValuesToDtoCar test
pkuehnel Jan 18, 2025
72a2f3d
Merge pull request #1757 from pkuehnel/feat/onlyUpdateFleetTelemetryO…
pkuehnel Jan 18, 2025
4556fbe
fix(FleetTelemetryWebSocketService): propertyUpdateTimeStamps not use…
pkuehnel Jan 18, 2025
cfcc568
Merge pull request #1758 from pkuehnel/fix/propertyUpdateTimeStampsFo…
pkuehnel Jan 18, 2025
165d9fe
feat(NewVersionCheckService): can display different messages based on…
pkuehnel Jan 18, 2025
ad68726
Merge pull request #1759 from pkuehnel/feat/differentVersionUpdateNot…
pkuehnel Jan 18, 2025
792d509
feat(CarBasicConfigurationValidator): improve Validation for car lice…
pkuehnel Jan 18, 2025
4e9cad5
Merge pull request #1760 from pkuehnel/feat/improveCarValidation
pkuehnel Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface ITeslaSolarChargerContext
Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken());
DatabaseFacade Database { get; }
DbSet<SpotPrice> SpotPrices { get; set; }
DbSet<TeslaToken> TeslaTokens { get; set; }
DbSet<BackendToken> BackendTokens { get; set; }
DbSet<TscConfiguration> TscConfigurations { get; set; }
DbSet<Car> Cars { get; set; }
DbSet<RestValueConfiguration> RestValueConfigurations { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace TeslaSolarCharger.Model.Entities.TeslaSolarCharger;

public class BackendToken(string accessToken, string refreshToken)
{
public int Id { get; set; }
public string AccessToken { get; set; } = accessToken;
public string RefreshToken { get; set; } = refreshToken;
public DateTimeOffset ExpiresAtUtc { get; set; }
}
22 changes: 9 additions & 13 deletions TeslaSolarCharger.Model/Entities/TeslaSolarCharger/Car.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public class Car
public string? Name { get; set; }
public string? Vin { get; set; }
public TeslaCarFleetApiState? TeslaFleetApiState { get; set; }
public bool IsFleetTelemetryHardwareIncompatible { get; set; }
public ChargeMode ChargeMode { get; set; }
public int MinimumSoc { get; set; }
public DateTime LatestTimeToReachSoC { get; set; }
Expand Down Expand Up @@ -40,24 +41,19 @@ public class Car
public CarStateEnum? State { get; set; }

public bool VehicleCommandProtocolRequired { get; set; }
public DateTime? VehicleRateLimitedUntil { get; set; }
public DateTime? VehicleDataRateLimitedUntil { get; set; }
public DateTime? CommandsRateLimitedUntil { get; set; }
public DateTime? WakeUpRateLimitedUntil { get; set; }
public DateTime? ChargingCommandsRateLimitedUntil { get; set; }
public bool UseBle { get; set; }
public string? BleApiBaseUrl { get; set; }
public bool UseFleetTelemetry { get; set; }
public bool UseFleetTelemetryForLocationData { get; set; }
public bool IncludeTrackingRelevantFields { get; set; }
public bool IsAvailableInTeslaAccount { get; set; }

public string? WakeUpCalls { get; set; }
public string? VehicleDataCalls { get; set; }
public string? VehicleCalls { get; set; }
public string? ChargeStartCalls { get; set; }
public string? ChargeStopCalls { get; set; }
public string? SetChargingAmpsCall { get; set; }
public string? OtherCommandCalls { get; set; }
public List<DateTime> WakeUpCalls { get; set; } = new();
public List<DateTime> VehicleDataCalls { get; set; } = new();
public List<DateTime> VehicleCalls { get; set; } = new();
public List<DateTime> ChargeStartCalls { get; set; } = new();
public List<DateTime> ChargeStopCalls { get; set; } = new();
public List<DateTime> SetChargingAmpsCall { get; set; } = new();
public List<DateTime> OtherCommandCalls { get; set; } = new();

public List<ChargingProcess> ChargingProcesses { get; set; } = new List<ChargingProcess>();
public List<CarValueLog> CarValueLogs { get; set; } = new List<CarValueLog>();
Expand Down
15 changes: 0 additions & 15 deletions TeslaSolarCharger.Model/Entities/TeslaSolarCharger/TeslaToken.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class TeslaSolarChargerContext : DbContext, ITeslaSolarChargerContext
public DbSet<HandledCharge> HandledCharges { get; set; } = null!;
public DbSet<PowerDistribution> PowerDistributions { get; set; } = null!;
public DbSet<SpotPrice> SpotPrices { get; set; } = null!;
public DbSet<TeslaToken> TeslaTokens { get; set; } = null!;
public DbSet<BackendToken> BackendTokens { get; set; } = null!;
public DbSet<TscConfiguration> TscConfigurations { get; set; } = null!;
public DbSet<Car> Cars { get; set; } = null!;
public DbSet<RestValueConfiguration> RestValueConfigurations { get; set; } = null!;
Expand Down Expand Up @@ -124,6 +124,41 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.WakeUpCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.VehicleDataCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.VehicleCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.ChargeStartCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.ChargeStopCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.SetChargingAmpsCall)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

modelBuilder.Entity<Car>()
.Property(e => e.OtherCommandCalls)
.HasConversion(timeListToString)
.Metadata.SetValueComparer(valueComparer);

}

#pragma warning disable CS8618
Expand Down
Loading
Loading