OpenHausIO / backend

HTTP API for the OpenHaus SmartHome/IoT solution
https://docs.open-haus.io
6 stars 2 forks source link

Disable trigger, fires regardless if enabled or not #509

Closed mStirner closed 1 month ago

mStirner commented 1 month ago

There is no filter for enabled/disable triggers. They fire regardless if enabled or not.

mStirner commented 1 month ago

There is a check if the trigger is enabled: https://github.com/OpenHausIO/backend/blob/dbf499ec68eb4ab7d4204ab21efea51133fe824c/components/scenes/class.trigger.js#L120-L123

I think this issue can be closed. The code that indicate that error, was while debuging #510

trigger-type.js


module.exports = {

    "cronjob": (trigger, params) => {
        cron.add(params.cron, () => {
            logger.info(`Cronjob "${params.cron}" trigger scene`);
            trigger.fire();
        });
    },

   ....

The log message was written, but in the trigger .fire() method, the enabled/disable check worked.