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

Deserialization of publicdata measures dont work #166

Open
eirikatdips opened this issue Mar 16, 2023 · 0 comments
Open

Deserialization of publicdata measures dont work #166

eirikatdips opened this issue Mar 16, 2023 · 0 comments

Comments

@eirikatdips
Copy link

eirikatdips commented Mar 16, 2023

Describe the bug

The json looks like this.

      "measures": {
        "02:00:00:3f:05:76": {
          "res": {
            "1678911481": [
              -7,
              86
            ]
          },
          "type": [
            "temperature",
            "humidity"
          ]
        },
        "70:ee:50:3f:59:8e": {
          "res": {
            "1678911496": [
              1018.8
            ]
          },
          "type": [
            "pressure"
          ]
        }
      },

So the propertynames are the mac adresses, and hence cant be deserialized.

public class Measures
{

    [JsonProperty("mac_address_NAModule1")]
    public MacAddressNAModule1 MacAddressNAModule1 { get; set; }

    [JsonProperty("mac_address_NAMain")]
    public MacAddressNAMain MacAddressNAMain { get; set; }

    [JsonProperty("mac_address_NAModule3")]
    public MacAddressNAModule3 MacAddressNAModule3 { get; set; }

    [JsonProperty("mac_address_NAModule2")]
    public MacAddressNAModule2 MacAddressNAModule2 { get; set; }
}

There are no properties named "mac_address_NAModule1", "mac_address_NAMain", etc

Runtime environement

Operating System (Platform and Version) :
.Net version (Core ? Full Framework ?) :

To Reproduce

Steps to reproduce the behavior:

Expected behavior

Actual behavior

How to reproduce

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant