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

"hide" fired & signal property from trigger class #339

Closed
mStirner opened this issue Sep 2, 2023 · 0 comments · Fixed by #342
Closed

"hide" fired & signal property from trigger class #339

mStirner opened this issue Sep 2, 2023 · 0 comments · Fixed by #342

Comments

@mStirner
Copy link
Member

mStirner commented Sep 2, 2023

In the trigger class, when you fetch scenes, you can see the properties signal & fired.
"Hide" them with enumarble=false.

Example:

        "triggers": [
            {
                "signal": {
                    "_events": {},
                    "_eventsCount": 1
                },
                "fired": null,
                "type": "webhook",
                "params": {
                    "_id": "647c43d8699309d9cb0dd189"
                },
                "_id": "647c4466699309d9cb0dd18f",
                "enabled": true
            }
        ]

To fix this, change in class.trigger.js:

    constructor(obj) {

        //this.signal = new TriggerSignal();
        this.signal = new EventEmitter();
        this.fired = null;

    }

to

    constructor(obj) {

        Object.defineProperty(this, "signal", {
            value: new EventEmitter(),
            writable: false,
            enumerable: false
        });

        Object.defineProperty(this, "fired", {
            value: null,
            writable: true,
            enumerable: false
        });

    }
mStirner added a commit to mStirner/backend that referenced this issue Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant