When I reference lul_settings in the startup method of my virtual device, I get a nil value exception.
I want to set the disabled property of the device according to conditions detected at startup. What code can I use to accomplish this.
Thanks,
When I reference lul_settings in the startup method of my virtual device, I get a nil value exception.
I want to set the disabled property of the device according to conditions detected at startup. What code can I use to accomplish this.
Thanks,
[tt]lul_settings[/tt] is a table-based parameter that’s only set/available inside the run/job section of [tt][/tt] blocks. It represents the table-of parameters passed to the [tt]ACTION[/tt] call.
See: http://wiki.micasaverde.com/index.php/Luup_Declarations
During the [tt][/tt] block you only have [tt]lul_device[/tt] (the Id of the device that’s currently starting up). You can use it to set state in variables (etc) using [tt]luup.variable_set(…)[/tt] or use [tt]luup.attr_set(…)[/tt] to change device-level attributes (ip, mac, etc, etc)
Thanks guessed.
I can’t see any documentation for the disabled property in the advanced tab. I am assuming it is a boolean and if true wil cause the device to be ignored in some way - not be loaded at startup? Do you know what effect this property has and if it is ok to use for my own purposes?
The documented list is here:
http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#variable:_devices
but it’s not up to date. In this case, without solid doco, I wouldn’t rely upon what the behavior is for this attr. There are definitely cases where you can blaze ahead, but not sure if this is one of them… since they could change the semantic of it (etc) and you could be in trouble
If you want to enable/disable a component you’re building, then it’s fairly simple to add a custom serviceVariable that’ll get you a similar effect.
Best Home Automation shopping experience. Shop at Ezlo!
© 2024 Ezlo Innovation, All Rights Reserved. Terms of Use | Privacy Policy | Forum Rules