net-daemon / netdaemon

An application daemon for Home Assistant written in .NET
MIT License
220 stars 63 forks source link

All values in Context are null or empty in StateChange objects #1156

Closed nuttytree closed 2 weeks ago

nuttytree commented 3 weeks ago

The problem

It appears the lazy deserialization of StateChanges in 24.33.0 broke the deserialization of the Context. In both the New and Old properties the Context has an empty string for the Id and null for ParentId and UserId. image

Environment

Running NetDaemon in Docker using the code in this repo nuttytree-netdaemon connected to Home Assistant version 2024.8.2 running in Docker.

Link to or paste code that causes the issue

Looks like the issue is the result of this pull request #1146

Traceback/Error logs

Additional information

nuttytree commented 3 weeks ago

My initial assessment leads me to believe the fix is to add JsonPropertyName attributes to the properties in the Context class.