rlindner / node-red-contrib-sma-webconnect

Node-RED node to query the web interface of SMA inverters
MIT License
13 stars 9 forks source link

Add test for responses with tags #15

Closed rlindner closed 3 years ago

rlindner commented 3 years ago

Hey @HoLo85, I've used the sample data you've provided here to write some unit test. One of the tests, which validates parsing "tag"-values failed, so I've extracted that test as this separate PR here.

Would you like to verify, if either the test data isn't correct or we need to adjust the parsing to support those tags properly? You can run the tests with npm test. I'd be happy for feedback if this setup works for you as well.

HoLo85 commented 3 years ago

Hi, as far as i can see the response for the tag value is wrong, if it is read from the inverter it looks like this:

{
    "6180_08652500": {
        "1": [
            {
                "val": [
                    {
                        "tag": 303
                    }
                ]
            }
        ]
    }
}
rlindner commented 3 years ago

Thanks, missed that bit. 👍