Domoticz Module for python editor outside of domoticz?

Python and python framework

Moderator: leecollings

Post Reply
DomoArigato
Posts: 36
Joined: Monday 30 April 2018 13:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Domoticz Module for python editor outside of domoticz?

Post by DomoArigato »

Hi all.
This is maybe a very newbie question and I have to admit I also didn’t think it through so maybe I ask something stupid now....
Can I somewhere find the domoticz module to install that on a win10 PC with Visual Studio Code as my python editor?
I thought then I could import this module and would be able to at least write the python code in that editor (with syntax highlighting, linter and such support) to copy it over to the domoticz machine afterwards to run it there....
Just to not need to write the code within the domoticz editor.

Thanks for all pointers to the right way - also for hints if this thinking is complete nonsense :)
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Domoticz Module for python editor outside of domoticz?

Post by febalci »

1. Since you use python, you still can use visual studio code without domoticz module. I use it this way for a long time and write my domoticz plugins on vstudio code.
2. You can use fakedomoticz.py which you can find on some domoticz plugin github pages.
DomoArigato
Posts: 36
Joined: Monday 30 April 2018 13:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Domoticz Module for python editor outside of domoticz?

Post by DomoArigato »

hi.

Thanks a lot for your answer.

I saw that fakedomoticz.py seems to "only" simulate .log(), .error() and -debug() functions of a domoticz object (when I understand it correctly...).
But I guess that when I import a domoticz module in a script there are many more functions/methods to the domoticz object to use in the python editor.
I thought there might be a way to make the editor (like vscode) "knowing" all available methods so that syntax highlighting etc. would work.

And I guess there is no way to test the script directly within the editor (or IDE), right?
how is your workflow when you develop in an external editor?

Thanks again for more hints and regards to @ll.
febalci
Posts: 331
Joined: Monday 03 July 2017 19:58
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Domoticz Module for python editor outside of domoticz?

Post by febalci »

I write code in vs code, copy it under plugins directory of a test domoticz installation media and test it there before going for live system. For debugging i use a lot domoticz.debug and log statements. I dont specifically remember if vs code had any problems with highlighting, but since it never came to my attention so far i assume there is no problem with lint (I will check it out for you)
And no, you can never debug it in vs code.
DomoArigato
Posts: 36
Joined: Monday 30 April 2018 13:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Domoticz Module for python editor outside of domoticz?

Post by DomoArigato »

Again thanks for your efforts.
I already thought so about debugging but just wanted to ask. Maybe some came along with some clever ideas ... 8-)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest