suggestion for .checkFirst()

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

suggestion for .checkFirst()

Post by emme »

ciao,

I was wodering if a possible change can be made to the checkFirst function in dzVents:

could the function include a log message in case of activation? (so the syntax would be .checkFirst(logMessage of operation is performed)
if no argument is given then it runs as usual

example:

Code: Select all

if dz.devices(myDev).state == 'Off' then
   dz.devices(myDev).switchOn()
   dz.log('Hey!... I\'m ON!!')
end

can be turned to:

Code: Select all

dz.devices(myDev).switchOn().checkFirst('Hey!... I\'m ON!!')
could it be a good idea? :P:P
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
bigpea
Posts: 91
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: IT
Contact:

Re: suggestion for .checkFirst()

Post by bigpea »

I like it..
guantolento
Posts: 129
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: suggestion for .checkFirst()

Post by guantolento »

very good ...
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
dioniso
Posts: 5
Joined: Tuesday 02 August 2016 12:12
Target OS: -
Domoticz version:
Contact:

Re: suggestion for .checkFirst()

Post by dioniso »

:o Mind blow!
dannybloe
Posts: 1355
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Ermelo
Contact:

Re: suggestion for .checkFirst()

Post by dannybloe »

But what if you want a message when it is NOT switching? Then you need two options. Isn’t it just for debugging purposes? If so I could also log debug info so you can put logging in debug mode
Creator dzVents - RPi3, loads of zwave devices, esp8266, evohome.
User avatar
emme
Posts: 909
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: suggestion for .checkFirst()

Post by emme »

mmmh that's nice either....
a .checkFirst(log true, log false, LOG_INFO) maybe?

I did not think about a 'not triggered' log but it is helpful indeed.

My intention was not only for debug issue but also for notification (of course we cannot add a lot of option in that function :P :P)
it looks very nice!!! :D
The most dangerous phrase in any language is:
"We always done this way"
Post Reply

Who is online

Users browsing this forum: Google [Bot], Wiers and 1 guest