How to use the level.current function in level

To help you get started, we’ve selected a few level examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github chkr1011 / Wirehome.Core / Wirehome.App.Old / appController.js View on Github external
else if (source.status["temperature.value"] !== undefined) {
                model.template = "views/temperatureSensorTemplate.html";
            }
            else if (source.status["humidity.value"] !== undefined) {
                model.template = "views/humiditySensorTemplate.html";

                model.dangerValue = getSetting(source.settings, "app.humidity.danger_value", 75);
                model.warningValue = getSetting(source.settings, "app.humidity.warning_value", 60);
            }
            else if (source.status["roller_shutter.state"] !== undefined) {
                model.template = "views/rollerShutterTemplate.html";
            }
            else if (source.status["state_machine.state"] !== undefined) {
                model.template = "views/stateMachineTemplate.html";
            }
            else if (source.status["level.current"] !== undefined) {
                model.template = "views/fanTemplate.html";
            }
            else if (source.status["color.red"] !== undefined) {
                model.template = "views/rgbTemplate.html";

                model.selectedColor = "#FFFFFF";
            }
            else if (source.status["power.state"] !== undefined) {
                model.template = "views/toggleTemplate.html";
            }
        }
    }