Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

hiding from debug screen onAction: returns


Mateo

Question

Hi

I'm calling from a scene a QA and would like to hide from the debug return the line launching the QA:

[QUICKAPP595]: onAction: {"deviceId":595,"args":["down"],"actionName":"hueBriControl"}

 

Do you know if there is any command that can prevent from displaying it ?

thanks :)

br

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
On 2/27/2021 at 3:27 AM, Mateo said:

Hi

I'm calling from a scene a QA and would like to hide from the debug return the line launching the QA:

[QUICKAPP595]: onAction: {"deviceId":595,"args":["down"],"actionName":"hueBriControl"}

 

Do you know if there is any command that can prevent from displaying it ?

thanks :)

br

 

If you used my

Please login or register to see this link.

you would have had that as an option.

...but breaking the magician's code, I will reveal it here ;-)

...add this to the QA:

Please login or register to see this code.

extended will work for UIEvents too

Edited by jgab
  • Like 1
Link to comment
Share on other sites

  • 0
  • Inquirer
  • Thanks @jgab, always carefully watching what you do ... but unfortunately not skilled enough yet to always follow you in all the improvements you propose for the community :)

    will have a look to you QA tools ;) and try the magic trick :)

    to be honest don't see yet how it works :)

     

    the thing is that when i make a call i see the command in the debug window, and i don't :)

    let see if i can do something with this :)thanks and have a great we

     

    Link to comment
    Share on other sites

    • 0
    On 2/27/2021 at 4:36 PM, Mateo said:

    Thanks @jgab, always carefully watching what you do ... but unfortunately not skilled enough yet to always follow you in all the improvements you propose for the community :)

    will have a look to you QA tools ;) and try the magic trick :)

    to be honest don't see yet how it works :)

     

    the thing is that when i make a call i see the command in the debug window, and i don't :)

    let see if i can do something with this :)thanks and have a great we

     

    Well, a lot of the QuickApp framework is written in Lua by Fibaro. When a method is called they log that with 

    Please login or register to see this code.

    What the hack does is that we redefine the print function (that fibaro uses) and if the first argument is "onAction: " we ignore it and don't print anything.

    The drawback is that if you yourself in your code do

    Please login or register to see this code.

    it will also not print that. However, we bet on that it is only Fibaro's print that have a "onAction: " string as the first argument.

     

    • Like 1
    Link to comment
    Share on other sites

    • 0
    On 2/27/2021 at 6:43 AM, jgab said:

     

    If you used my

    Please login or register to see this link.

    you would have had that as an option.

    ...but breaking the magician's code, I will reveal it here ;-)

    ...add this to the QA:

    Please login or register to see this code.

    extended will work for UIEvents too

    Hello, interesting by this workaround, i'd like to implement it into my QAs

    Can you give me more details about the way to do it ?

    Thanks

    Link to comment
    Share on other sites

    • 0
    2 minutes ago, LMSI said:

    Hello, interesting by this workaround, i'd like to implement it into my QAs

    Can you give me more details about the way to do it ?

    Thanks

    Well, it's just to include the code above - have you tried that?

    Link to comment
    Share on other sites

    • 0
    9 minutes ago, jgab said:

    Well, it's just to include the code above - have you tried that?

    I have to create a function for that or put this code anywhere???

    Link to comment
    Share on other sites

    • 0
    7 minutes ago, LMSI said:

    I have to create a function for that or put this code anywhere???

    Something like this into my QAs ?
     
    do 
        local p = print
        function print(a,...) if a~='onAction: ' then p(a,...) end end
    end
     
    function QuickApp:lectureIPX10()
        self.http = net.HTTPClient()
        local address = "http://"..self:getVariable("IPipx").."/api/xdevices.json?cmd=10"
    ......
    .....
    Link to comment
    Share on other sites

    • 0
    1 hour ago, LMSI said:
    Something like this into my QAs ?
     
    do 
        local p = print
        function print(a,...) if a~='onAction: ' then p(a,...) end end
    end
     
    function QuickApp:lectureIPX10()
        self.http = net.HTTPClient()
        local address = "http://"..self:getVariable("IPipx").."/api/xdevices.json?cmd=10"
    ......
    .....

    In you "main file" where you have onInit defined, start by redefining the print function (the do ... end wrapper is just to keep the local p from not clashing with any of you other variables.)

    Please login or register to see this code.

    Fibaro may redefine print themselves before onInit so we can't do it outside of onInit...
     
    Link to comment
    Share on other sites

    • 0
    2 hours ago, jgab said:

    In you "main file" where you have onInit defined, start by redefining the print function (the do ... end wrapper is just to keep the local p from not clashing with any of you other variables.)

    Please login or register to see this code.

    Fibaro may redefine print themselves before onInit so we can't do it outside of onInit...
     

    OK fine!!

    Now it's ok......Thanks a lot

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...