Hidden array for devicechanged

Post Reply
Posts: 504
Joined: Saturday 30 August 2014 20:20
Target OS: Raspberry Pi
Domoticz version:
Location: Spain

Hidden array for devicechanged

Post by juankar » Friday 30 December 2016 15:19

ThermostatMode can not be read from Lua or Blocky. I tried to use sValue for this operation (modifying source code) but Gizmocuz told me that it was not a solution and that I could have a look to EventSystem.cpp
So I've studied EventSystem.cpp and I've found undocumented code that can improve the use of event's scripts. I suppose it's a beta and I don't know if it will remain.... (I've just seen that it was commited on Nov 14 #982)
My actual version is 6048
There is an array named devicechanged_ext with fields idx, svalue and nvalue
So in our lua scripts we can check devicechanged_idx["idx"] or devicechanged_idx["nvalue"]

Then if we can not read value in for a devicechanged["name-of-device"] we can use devicechanged_ext["nvalue"]

Is this a permanent change? could it be documented in wiki?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests