Python plugin: Python plugin installer!

Python and python framework
Post Reply
blauwebuis
Posts: 363
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Python plugin: Python plugin installer!

Post by blauwebuis » Thursday 22 February 2018 1:27

A plugin to easily install other python plugins :D

Just paste in the URL into this plugin's input field, and it will do the rest.

- It downloads the zip file URL you provide, unpacks that file into a new plugin directory, and finally CHMOD's the plugin.py file.
- The URL you provide is processed when you press "update" on the plugin, or when Domoticz boots.
- It checks to see that it hasn't already processed the current URL (and that it's a valid URL).

Download and install
https://github.com/flatsiedatsie/Domoti ... -installer

User avatar
EdwinK
Posts: 1411
Joined: Sunday 22 January 2017 22:46
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Rhoon
Contact:

Re: Python plugin: Python plugin installer!

Post by EdwinK » Thursday 22 February 2018 10:08

Trying this one out.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | RFxcom | Dashticz V2

User avatar
ycahome
Posts: 217
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python plugin: Python plugin installer!

Post by ycahome » Thursday 22 February 2018 10:29

Nice idea!!

I would prefer if your plugin had a predefined list of plugins/urls for installation.

For example,
- you could agree on one or two sources (ex. github and http download).
- all plugin developers will provide their urls
- you will update your config file every now and then in order to include new plugins
- also, on github there is a way to discover if there any code updates. That way you can prepare a notification about plugins with updates.

To be honest, am searching for spare time in order to do that by myself (although i think that should be part of the core domoticz).
If you have time to do it, would be nice.

fkok
Posts: 36
Joined: Thursday 19 January 2017 10:19
Target OS: Raspberry Pi
Domoticz version:
Location: Netherlands
Contact:

Re: Python plugin: Python plugin installer!

Post by fkok » Thursday 22 February 2018 11:09

ycahome wrote:
Thursday 22 February 2018 10:29
Nice idea!!

I would prefer if your plugin had a predefined list of plugins/urls for installation.

For example,
- you could agree on one or two sources (ex. github and http download).
- all plugin developers will provide their urls
- you will update your config file every now and then in order to include new plugins
- also, on github there is a way to discover if there any code updates. That way you can prepare a notification about plugins with updates.

To be honest, am searching for spare time in order to do that by myself (although i think that should be part of the core domoticz).
If you have time to do it, would be nice.
That would be fantastic!!!

blauwebuis
Posts: 363
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Python plugin: Python plugin installer!

Post by blauwebuis » Friday 23 February 2018 12:15

@ycahome: that is the direction Domoticz is/should be heading.

See this feature request:
https://github.com/domoticz/domoticz/issues/2057

It has also been discussed with Gizmocus. But there is no time path.

A more practical reason why it's not really possible to create a more complex plugin to manage plugins (and themes), is that the plugin infrastructure does not yet support:
- A way to show data output on the hardware page (update text in a textarea for example). This makes it impossible to give users feedback on their actions, or create more complex interfaces there.
- Similarly, there is no option to create something like a button ("click to install") or checkbox ("keep plugins updated automatically).

I hope the python plugin system will go in this direction. Ideally, it would allow each plugin to come with a little bit of javascript too. Then you could create advanced mini-interfaces for each plugin on their respective hardware pages. (Or allow plugins to add JS features, as a bonus)

User avatar
ycahome
Posts: 217
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python plugin: Python plugin installer!

Post by ycahome » Friday 23 February 2018 13:43

I took a snap on the feature request and I think that developer's feedback is more than justified.

But, in order to return to our discussion, humans often make thoughts in a more complex way that really needed.
Since you are running on root context, theoretically, you can do anything from within your plugin (add crontab job/send notification/run git update).

I will try to create a demo plugin to see if this can be done.

User avatar
ycahome
Posts: 217
Joined: Sunday 12 February 2017 11:55
Target OS: Linux
Domoticz version: lat Beta
Contact:

Re: Python plugin: Python plugin installer!

Post by ycahome » Friday 23 February 2018 20:29


Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests