Skip to content

Thing with multiple properties... only last property works #108

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

Closed
LasseRosenow opened this issue Apr 12, 2020 · 1 comment
Closed

Thing with multiple properties... only last property works #108

LasseRosenow opened this issue Apr 12, 2020 · 1 comment

Comments

@LasseRosenow
Copy link

LasseRosenow commented Apr 12, 2020

I am using the current version of this library.

When i create a simple Thing that only has a on off button, everything works fine.
But if I add more options to it I get null as the value for the href properties fo the properties property.

Example:
I used the example code from this project: https://github.com/mozilla-iot/webthing-arduino/blob/master/examples/RGBLamp/RGBLamp.ino

[
    {
        "id": "lasse-lightstrip",
        "title": "Lasse Lightstrip",
        "@context": "https://iot.mozilla.org/schemas",
        "base": "http://192.168.178.32/",
        "securityDefinitions": {
            "nosec_sc": {
                "scheme": "nosec"
            }
        },
        "security": "nosec_sc",
        "@type": [
            "Light",
            "OnOffSwitch",
            "ColorControl"
        ],
        "links": [
            {
                "rel": "properties",
                "href": "/things/lasse-lightstrip/properties"
            },
            {
                "rel": "actions",
                "href": "/things/lasse-lightstrip/actions"
            },
            {
                "rel": "events",
                "href": "/things/lasse-lightstrip/events"
            },
            {
                "rel": "alternate",
                "href": "ws://192.168.178.32/things/lasse-lightstrip"
            }
        ],
        "properties": {
            "color": {
                "type": "string",
                "description": "The color of light in RGB",
                "@type": "ColorProperty",
                "links": [
                    {
                        "href": "/things/lasse-lightstrip/properties/color"
                    }
                ]
            },
            "level": {
                "type": "number",
                "description": "The level of light from 0-100",
                "@type": "BrightnessProperty",
                "links": [
                    {
                        "href": null
                    }
                ]
            },
            "on": {}
        }
    }
]

As you can see the BrightnessProperty has href tags with null.
And the OnOffProperty is missing..

@mrstegeman
Copy link
Contributor

You need to set LARGE_JSON_BUFFERS. See here: https://github.com/mozilla-iot/webthing-arduino/blob/master/README.md#configuration

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

2 participants