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


Visual Studio Code (vscode) for QuickApp development


jgab

Recommended Posts

@jgabin the manual you show a way to kill the task to free up port 5004 on a Mac. Is there a similar way to kill the task in Windows 11? Or, barring that, what would be the name of the task to hunt for in Task Manager? 

Link to comment
Share on other sites

  • Topic Author
  • I'm not really a windows person... but

    I found a powersshell script that works (I tested it on windows)

    I included it in ./examples/kill-port.ps1

    Please login or register to see this code.

    You can run it in the terminal in vscode (make sure the terminal is of type powershell)

    Please login or register to see this code.

    You may need to set the rights to run local powershell scripts.

    You do it in Settings -> Privacy & Security -> For developers -> PowerShell

    Please login or register to see this link.

     

    Link to comment
    Share on other sites

    @jgab I have added the noStock directive to my QA as shown below. I am running v. 0.36 which I updated this morning. However, I cannot see the "stock ui" elements for either my com.fibaro.binarySwitch or my com.fibaro.multilevelSwitch children.

     

    Please login or register to see this attachment.

    Also, my parent is implemented as a com.fibaro.deviceController. For that UI there is an element displayed which appears to be either a label or a button. However, I can't seem to do anything with it (so it must be a label?). It displays when noStock is true or false.

    Please login or register to see this image.

    /monthly_2023_08/image.png.0c3c59188f29a03fb85586c8388df92b.png" />

     

    Link to comment
    Share on other sites

  • Topic Author
  • Ok, it was only implemented for main QAs - now added to QuickAppChildren too...

    The rectangle you see is just an empty UI frame with no controllers/text inside. I may remove the frame for an empty UI...

    Edited by jgab
    Link to comment
    Share on other sites

    11 hours ago, jgab said:

    Ok, it was only implemented for main QAs - now added to QuickAppChildren too...

    The rectangle you see is just an empty UI frame with no controllers/text inside. I may remove the frame for an empty UI...

     

    Thank you. The empty frame is no big deal, I just relay things I notice. Think of my observations as an additional set of eyes.

    • Thanks 1
    Link to comment
    Share on other sites

    I was trying to use the api.delete() method to remove a child device in the Fibemu. When it executed there was a crash in the emulator. It is probably something boneheaded I am doing. Here's the code & debug output I got.

     

    Please login or register to see this attachment.

     

    The childID has the value 5001 (an integer). Thus the string strRestURL contains `/plugins/removeChildDevice/5001`. I used a string to inspect its contents while stepping through using the debugger.

     

    The lead in to this is I created a UI button on the main device which calls my method to clean up my stuff. Once I clean up, I want to delete the child device. Obviously I don't want to have this button in the final product but I have no other way to remove a child device in Fibemu. On the Z-Box I can hit the trash can in the device setup. My rationale for this would be to reinitialize the child device if I touch up my ui view. Perhaps that's unnecessary but I learn by doing.

     

    Thanks again. 😎

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, PeterV959 said:

    I was trying to use the api.delete() method to remove a child device in the Fibemu. When it executed there was a crash in the emulator. It is probably something boneheaded I am doing. Here's the code & debug output I got.

     

    Please login or register to see this attachment.

     

    The childID has the value 5001 (an integer). Thus the string strRestURL contains `/plugins/removeChildDevice/5001`. I used a string to inspect its contents while stepping through using the debugger.

     

    The lead in to this is I created a UI button on the main device which calls my method to clean up my stuff. Once I clean up, I want to delete the child device. Obviously I don't want to have this button in the final product but I have no other way to remove a child device in Fibemu. On the Z-Box I can hit the trash can in the device setup. My rationale for this would be to reinitialize the child device if I touch up my ui view. Perhaps that's unnecessary but I learn by doing.

     

    Thanks again. 😎

    Sorry, the remove method was never implemented (never done it yet :-) )

    1 line of code - fixed.

    Link to comment
    Share on other sites

    6 hours ago, jgab said:

    Sorry, the remove method was never implemented (never done it yet :-) )

    1 line of code - fixed.

    All good. I thought that was the case. I did see it in the documentation and based my attempt on that. I have also marveled at the thoroughness of your error checking so I thought I would give this a try.

    Link to comment
    Share on other sites

  • Topic Author
  • 56 minutes ago, PeterV959 said:

    All good. I thought that was the case. I did see it in the documentation and based my attempt on that. I have also marveled at the thoroughness of your error checking so I thought I would give this a try.

    error checking - and in particular giving users good error messages is the most difficult task when providing a framework (just ask Fibaro ;-) ) 

    Link to comment
    Share on other sites

    On 8/25/2023 at 7:12 AM, jgab said:

    error checking - and in particular giving users good error messages is the most difficult task when providing a framework (just ask Fibaro ;-) ) 

    Why would I, or anyone else, ask Fibaro anything? They never respond. Makes one think they don't even exist. 😎

    Link to comment
    Share on other sites

    • 1 month later...

    Hey Jan,
    I think a small bug in fibemu ;-)

    Please login or register to see this code.


    This code returns and error due to the "timeout' option. it works without any option...

     

    Here is the debug console...
     

    Please login or register to see this code.


     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, chelson said:

    Hey Jan,
    I think a small bug in fibemu ;-)

    Please login or register to see this code.


    This code returns and error due to the "timeout' option. it works without any option...

     

    Here is the debug console...
     

    Please login or register to see this code.


     

    Yep, had misspelled socket instead of sock for the timeout function... I pushed a new version to GitHub (it's the fibnet.py that was updated)

     

     

    Link to comment
    Share on other sites

    • 1 month later...
  • Topic Author
  • 10 hours ago, gurpal2000 said:

    I can't seem to get the thing installed on windows 11. Can everyone else? see 

    Please login or register to see this link.

    What version of Python have you installed?

    Here I install on a clean Windows11

     

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jgab said:

    What version of Python have you installed?

    Here I install on a clean Windows11

     

    I just tried again on win11 and it works with python 3.11 - it may have issues with python 3.12

    Link to comment
    Share on other sites

  • Topic Author
  • 46 minutes ago, jgab said:

    I just tried again on win11 and it works with python 3.11 - it may have issues with python 3.12

    So it turns out that python 3.12 that is still pretty new doesn't have precompiled "wheels" (used by cython)  that is required by Lupa (and many other packages)

    It may solve itself soon as 3.12 fixes it - or Lupa may fix it soon - or I may discover a workaround...

    For now, use 3.11.

    Link to comment
    Share on other sites

  • Topic Author
  • So there is actually a 2.1 version of Lupa prepared that has support for 3.12

    Please login or register to see this link.

    but it's not released as a python package yet. I guess you could download and compile yourself if you really need 3.12.

    Link to comment
    Share on other sites

    @jgab thanks for your quick diagnosis. No problem, I simply downloaded the latest version and assumed it would work. You'd think aa 3.11 vs 3.12 wouldn't introduce 'breaking' changes.

     

    I will give 3.11 a go shortly

    Edited by gurpal2000
    Link to comment
    Share on other sites

  • Topic Author
  • 37 minutes ago, gurpal2000 said:

    @jgab thanks for your quick diagnosis. No problem, I simply downloaded the latest version and assumed it would work. You'd think aa 3.11 vs 3.12 wouldn't introduce 'breaking' changes.

     

    I will give 3.11 a go shortly

    3.12 is still quite new and many packages are not up to date yet.  And the Lupa module that fibemu uses will soon update to be 3.12 compatible.
    In vscode (or rather python) you can have virtual python environment with it's own python version and libraries - can be worth looking into.

    Link to comment
    Share on other sites

    34 minutes ago, jgab said:

    3.12 is still quite new and many packages are not up to date yet.  And the Lupa module that fibemu uses will soon update to be 3.12 compatible.
    In vscode (or rather python) you can have virtual python environment with it's own python version and libraries - can be worth looking into.

     

    3.11 worked Great!

    Yes aware of virtual envs in other langs too. It's all in VM at the moment so trash the whole thing (or restore to a base install) in case something goes wrong at least.

     

    Out of interest what level of permissions is required for the Visual Studio integration (as per the config.json)? I will try my existing user, but could it be best practice to create a separate user specifically for fibemu?

    Edited by gurpal2000
    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...