System.Text.Json.JsonException: The JSON value could not be converted to System.String. Path: $[14].sw_version | LineNumber: 0 | BytePositionInLine: 7227.
---> System.InvalidOperationException: Cannot get the value of a token type 'Number' as a string.
at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_ExpectedString(JsonTokenType tokenType)
at System.Text.Json.Utf8JsonReader.GetString()
at System.Text.Json.Serialization.Metadata.JsonPropertyInfo`1.ReadJsonAndSetMember(Object obj, ReadStack& state, Utf8JsonReader& reader)
at System.Text.Json.Serialization.Converters.ObjectDefaultConverter`1.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.JsonCollectionConverter`2.OnTryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, TCollection& value)
at System.Text.Json.Serialization.JsonConverter`1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
--- End of inner exception stack trace ---
at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, Utf8JsonReader& reader, Exception ex)
at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
at System.Text.Json.JsonSerializer.Deserialize[TValue](JsonElement element, JsonSerializerOptions options)
at NetDaemon.Client.Internal.HomeAssistantConnection.SendCommandAndReturnResponseAsync[T,TResult](T command, CancellationToken cancelToken)
at NetDaemon.Client.HomeAssistant.Extensions.HomeAssistantConnectionExtensions.GetDevicesAsync(IHomeAssistantConnection connection, CancellationToken cancelToken)
at NetDaemon.HassModel.Internal.RegistryCache.ReloadDevices()
at NetDaemon.HassModel.Internal.RegistryCache.InitializeAsync(CancellationToken cancellationToken)
at NetDaemon.HassModel.Internal.CacheManager.InitializeAsync(CancellationToken cancellationToken)
at NetDaemon.Runtime.Internal.NetDaemonRuntime.OnHomeAssistantClientConnected(IHomeAssistantConnection haConnection, CancellationToken cancelToken)
at NetDaemon.Runtime.Internal.NetDaemonRuntime.StartAsync(CancellationToken stoppingToken)
at NetDaemon.Runtime.Internal.RuntimeService.StartAsync(CancellationToken cancellationToken)
at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
The problem
NetDaemon fails to start due to an error in HomeAssistantConnectionExtensions.GetDevicesAsync when a device's sw_version is returned as an integer.
Environment
Link to or paste code that causes the issue
Looks like the issue is the result of this commit on pull #1114 https://github.com/net-daemon/netdaemon/blob/7f9914ec87b66c2a4e45eb46261c48f15360f931/src/Client/NetDaemon.HassClient/Common/HomeAssistant/Model/HassDevice.cs#L26
Traceback/Error logs
Additional information
The device json that causes the error: