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

Can't set data with key named other than "data" #33

Open
Nertskull opened this issue Nov 18, 2022 · 0 comments
Open

Can't set data with key named other than "data" #33

Nertskull opened this issue Nov 18, 2022 · 0 comments

Comments

@Nertskull
Copy link

Nertskull commented Nov 18, 2022

If I have a FSM defined similar to as as follows:

 {
    "state": {
        "status": "OFF-RESET",
        "data": {
            "light-state": 0
        }
    },
    "transitions": {
        "OFF-RESET": {
            "motion-on": {
                "status": "ON-TRANSITIONING",
                "data": {
                    "light-state": "1"
                }
            },
            "switched-on": {
                "status": "ON-SWITCHED",
                "data": {
                    "light-state": "1"
                }
            },

then everything works as expected. But is must be named "data". Is there a way to change it to a different key name? Such as this:

   {
    "state": {
        "status": "OFF-RESET",
        "set-values": {
            "light-state": 0
        }
    },
    "transitions": {
        "OFF-RESET": {
            "motion-on": {
                "status": "ON-TRANSITIONING",
                "set-values": {
                    "light-state": "1"
                }
            },
            "switched-on": {
                "status": "ON-SWITCHED",
                "set-values": {
                    "light-state": "1"
                }
            },

If I do anything like this, and then put a debug node w/ msg.payload.set-values, I get light-state: 0. But it never will change to 1. I would prefer to not use "data" as that payload.data is used for so many things and conflicts with some of my other nodes. Is there a way to do this?

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