We had a short discussion here: https://knx-user-forum.de/smartvisu/...el-plugin.html
And here you can find a basic skeleton to start with: https://github.com/mknx/smarthome/tr...ugins/skeleton
Additionally, look at the other plugins and try to understand, how they work.
As I said, I never tried to use a C++ library in Python. But according to this, it is possible.
Ankündigung
Einklappen
Keine Ankündigung bisher.
Integration of Libs?
Einklappen
X
-
I will try to work with that.... I must try to order a Shield, then try doing the import.
Is there any kind of guidelines anywhere on how to write a plugin?
Will it make any problems if the library is a C++ library?
Einen Kommentar schreiben:
-
I've never tried that before, therefore everything I suggest is not tested. If you want to use it in a logic, then try to import it there. The better way in my opinion is, to write your own plugin. If the library is available on a packet manager for an easy installation, than you can just leave a note in your README.md that this plugin has additonal dependencies and how to install them. Otherwise you can put the needed libraries directly in your plugin folder and import them from there. The advantage of a plugin is, that the structure is clearer (what is called when on an item update), the item tree just uses your attribute to mark some items to be handled by your plugin (also clearer than working with watch_item in the logic conf if there are several items involved) and that it's easier to share.
Einen Kommentar schreiben:
-
Seems like the Import Library is a default command in Python 3.... But where to call it if i want to use it in HS.py? Should it be called in the logic.conf? or?
Einen Kommentar schreiben:
-
Integration of Libs?
Hello.
This have been discussed in another thread (Arduino Link), where the thread took a turn in a different way, that's why i make this new thread, since the problem is another now
- hopefully that's ok 
Earlier 2ndsky was involved in the discussion - thanks a lot for that
If i have a situation where i want to include some librarys to other functions on my sh.py - is that possible?
If the librarys works from the CLI of my PI, wouldn't i then be able to use them together with the Sh.py - on the same way as done with the library to access the PI's GPIO?Stichworte: -


Einen Kommentar schreiben: