Skip to content

Commit

Permalink
Fix updated track not being displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasMH committed Jan 11, 2024
1 parent 3377991 commit 25e1305
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/RejsePlanenToMqttBackgroundService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// See https://aka.ms/new-console-template for more information
using HomeAssistantDiscoveryNet;
using MQTTnet;
using NodaTime;
using NodaTime.Text;
Expand Down Expand Up @@ -90,7 +91,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
DueAt = (tripStart.RealtimeDate ?? tripStart.Date) + " " + (tripStart.RealtimeTime ?? tripStart.Time),
ScheduledAt = tripStart.Date + " " + tripStart.Time,
Route = firstLeg.Name,
Track = tripStart.Track,
Track = tripStart.RealtimeTrack ?? tripStart.Track,
Type = firstLeg.Type
});
}
Expand Down Expand Up @@ -121,7 +122,7 @@ public class TripMqttStatusUpdateAttributes
public long Timestamp { get; set; }

[JsonPropertyName("trips")]
public List<TripMqttStatusUpdateAttributesTripInfo> Trips { get; set; } = new List<TripMqttStatusUpdateAttributesTripInfo>();
public List<TripMqttStatusUpdateAttributesTripInfo> Trips { get; set; } = [];
}

public class TripMqttStatusUpdateAttributesTripInfo
Expand Down
6 changes: 3 additions & 3 deletions src/Rejseplanen2Mqtt.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.5" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
<PackageReference Include="NodaTime" Version="3.1.10" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.6.0-rc.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.6.0" />
<PackageReference Include="ToMqttNet" Version="2.3.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="ToMqttNet" Version="3.0.2" />
</ItemGroup>

</Project>

0 comments on commit 25e1305

Please sign in to comment.