suggestion for .checkFirst()

Easy to use, 100% Lua-based event scripting framework.
Post Reply
User avatar
emme
Posts: 891
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

suggestion for .checkFirst()

Post by emme » Wednesday 14 February 2018 17:52

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: 121
Joined: Thursday 11 August 2016 12:30
Target OS: Raspberry Pi
Domoticz version:
Location: IT
Contact:

Re: suggestion for .checkFirst()

Post by bigpea » Wednesday 14 February 2018 18:16

I like it..

guantolento
Posts: 182
Joined: Saturday 01 October 2016 14:48
Target OS: Raspberry Pi
Domoticz version: LastBeta
Location: Italy BG
Contact:

Re: suggestion for .checkFirst()

Post by guantolento » Wednesday 14 February 2018 18:41

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 » Wednesday 14 February 2018 18:59

:o Mind blow!

dannybloe
Posts: 1478
Joined: Friday 29 August 2014 11:26
Target OS: Raspberry Pi
Domoticz version:
Location: Ermelo
Contact:

Re: suggestion for .checkFirst()

Post by dannybloe » Wednesday 14 February 2018 20:10

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: 891
Joined: Monday 27 June 2016 11:02
Target OS: Raspberry Pi
Domoticz version: latest
Location: Milano, Italy
Contact:

Re: suggestion for .checkFirst()

Post by emme » Wednesday 14 February 2018 22:17

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: No registered users and 1 guest