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


How to inform user about device being disabled


Recommended Posts

Hello

 

Can we somehow inform user, if Quickapp device has been disabled?

Like print it on some label on QA's interface.

Problem is, that i can't make it by any code, as the code is not run, while device is disabled..

Is there any workaround?

Link to comment
Share on other sites

You could build a QuickApp that checks now and then which devices are disabled and show them in the label of that new QuickApp. 

Link to comment
Share on other sites

  • Topic Author
  • 2 minutes ago, SmartHomeEddy said:

    You could build a QuickApp that checks now and then which devices are disabled and show them in the label of that new QuickApp. 

    Thanks, yes i know that, but i was looking for some solution, that can be used on the Quickapp itself, internally, and not by checking from another quickapp.

    But probably this is not possible,  as device is disabled, so there is no way to interact with it.

    Link to comment
    Share on other sites

    Ah, ok

     

    You can see it in the debug log when the QuickApp is being disabled with this code in onInit():

     

    Please login or register to see this code.


    You could add some other code to show it somewhere else. 

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, SmartHomeEddy said:

    Ah, ok

     

    You can see it in the debug log when the QuickApp is being disabled with this code in onInit():

     

    Please login or register to see this code.


    You could add some other code to show it somewhere else. 

    Yeah, but how to cacth it? How to cacth, when this DISABLED state occours.. Does it trigger some event? Ot how else to cacth it from inside the quickapp. Should I listen in a loop to the ENABLED property change??? But if I do so, and the quickapp gets disabled, my code also stops working...thats the point...

    Link to comment
    Share on other sites

    If the QuickApp runs and you disable it, it starts the onInit() and you catch it with this code. 
     

    BTW without this code, the QuickApp still runs. 

    Link to comment
    Share on other sites

    yes, but @Neo Andersson uses fibaroExtra, or? that code intercepts onInit and disables the QA, like in your example.

    Link to comment
    Share on other sites

  • Topic Author
  • 1 minute ago, jgab said:

    yes, but @Neo Andersson uses fibaroExtra, or? that code intercepts onInit and disables the QA, like in your example.

    yes i am using Fibaroextra

    Link to comment
    Share on other sites

    ok, I pushed a new version of fibaroExtra v0.957 with a fix.

    define the function fibaro.__disabled and it will be called when the qa is disabled. there you can set a label or something in the qa ui.

    Please login or register to see this code.

     

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

  • Topic Author
  • 2 hours ago, jgab said:

    ok, I pushed a new version of fibaroExtra v0.957 with a fix.

    define the function fibaro.__disabled and it will be called when the qa is disabled. there you can set a label or something in the qa ui.

    Please login or register to see this code.

     

    Great..thanks

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Neo Andersson said:

    Great..thanks

    Jan, when i disable the QA, it still reacts to button clicks. (ofcourse throwing some errors, as all the variables are not loaded)

    Is this normal? I mean, is it normal, that user can still click on buttons and functions are called on button clicks?

    Edited by Neo Andersson
    Link to comment
    Share on other sites

    13 hours ago, Neo Andersson said:

    Jan, when i disable the QA, it still reacts to button clicks. (ofcourse throwing some errors, as all the variables are not loaded)

    Is this normal? I mean, is it normal, that user can still click on buttons and functions are called on button clicks?

    Yes it is. You need to redefine action and UI handler to not accept any events.
     

    Please login or register to see this code.

     

    • Like 1
    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
    Reply to this topic...

    ×   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...