Skip to content

Commit

Permalink
Merge pull request #989 from pkuehnel/feat/addApiIssue
Browse files Browse the repository at this point in the history
feat(IssueValidationService): add information about new api
  • Loading branch information
pkuehnel authored Nov 25, 2023
2 parents d2e10b1 + c40a3eb commit 5e38d3d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
<h3>Issues:</h3>
@foreach (var issue in _issues)
{
<div style="background-color: @(issue.IssueType == IssueType.Error ? "red" : "yellow")">
<div style="background-color: @(issue.IssueType switch
{
IssueType.Error => "red",
IssueType.Warning => "yellow",
_ => "white",
})">
<div>@issue.IssueMessage</div>
@if (issue.PossibleSolutions.Length > 0)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ public class IssueKeys
public string VersionNotUpToDate = "VersionNotUpToDate";
public string CorrectionFactorZero = "CorrectionFactorZero";
public string ServerTimeZoneDifferentFromClient = "ServerTimeZoneDifferentFromClient";
public string NewTeslaApi = "NewTeslaApi";
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ public PossibleIssues(IssueKeys issueKeys)
"Update the TimeZone of the TeslaSolarChargerContainer in your docker-compose.yml."
)
},
{
issueKeys.NewTeslaApi, CreateIssue("New cars are currently not supported",
IssueType.Information,
"If there are any updates on this topic, I will post them <a href=\"https://github.com/pkuehnel/TeslaSolarCharger/issues/988\" target=\"_blank\">here</a>.",
"Sorry for this information beeing not removable - it will be possible in a future update."
)
},
};
}

Expand Down
5 changes: 4 additions & 1 deletion TeslaSolarCharger/Server/Services/IssueValidationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ public IssueValidationService(ILogger<IssueValidationService> logger, ISettings
public async Task<List<Issue>> RefreshIssues(TimeSpan clientTimeZoneId)
{
_logger.LogTrace("{method}()", nameof(RefreshIssues));
var issueList = new List<Issue>();
var issueList = new List<Issue>
{
_possibleIssues.GetIssueByKey(_issueKeys.NewTeslaApi),
};
issueList.AddRange(GetServerConfigurationIssues(clientTimeZoneId));
if (Debugger.IsAttached)
{
Expand Down

0 comments on commit 5e38d3d

Please sign in to comment.