dannybloe wrote:You mean something like this: switchToNormal(), switchToAlarm()
And the toggles of course.
Hmmm. Probably not since the devices are read-only.
I'm looking in domoticz.lua about line 170 where you booleanize some strings. I'm suggesting you add:
and
... pretty please.
BTW I'm thinking you're going to be a hostage to fortune trying to implement your negate function because a) you'll find it hard to get a complete list of things to negate, and b) find it even harder to produce a correct list of their inverts for all devices.
By all means have a capability to Invert On to Off and vis versa but anything else is only going to complicate things, not necessarily the code but the documentation. Where do you stop in providing capabilities that can be done in native LUA fairly easily? Are you going to provide and a .increment and .decrement function because it takes two extra lines of code, or perhaps provide a .area or .circumference function? Where do you stop?
What might be handy, however, is a capability whereby users can have a library of functions that are accessible to each of their scripts. Such a library might include a users very own Negate function. I used to have LUA scripts that used the require function but I'm not sure if dzVents would preclude this. Used to be neat because I could write code that created LUA modules on the fly and then include them conditionally or at some future time. It proved useful to provide persistence before variables were introduced.
Keep up the good work. I really don't want to go back to native LUA.
Peter