Page 1 of 1

Using CustomImages with the Python framework

Posted: Friday 24 February 2017 13:19
by Dnpwwo
The next beta will have functionality to allow developers to add custom images to plugins.

Have a look at the documentation here: http://www.domoticz.com/wiki/Developing ... gin#Images if you are interested

Basically, standard Domoticz custom images zips can be loaded from the plugin's home folder and the framework makes the actual image number available to the plugin so that it can be set using the existing Device.Update() function.

The example on the wiki shows how to give users the choice of three images via the hardware page but the image can be set for any reason: linked to device state or device value (like the standard weather devices)

Re: Using CustomImages with the Python framework

Posted: Friday 24 February 2017 13:32
by remb0
Great job :!:

Re: Using CustomImages with the Python framework

Posted: Friday 24 February 2017 15:10
by gerardvs
Yeah, great addition!

I was already thinking how to dynamically change icons. Ideally generating a small picture with a course graph or symbol with the python plugin and show it on the fly. This is a useful step towards that idea.

--Gerard

Re: Using CustomImages with the Python framework

Posted: Wednesday 08 March 2017 21:48
by tester22
I tried to use the function in the Sonos Plugin. Works on my Pi but another user got the following error:

2017-03-08 14:22:54.664 (Sonos Eetkamer) Initialized version 1.0, author 'tester22'
2017-03-08 14:22:54.719 Error: Domoticz received fatal signal 11 !...
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz() [0x1be334]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1be3ec]
2017-03-08 14:22:54.732 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76add180]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZNSs6assignERKSs+0x98) [0x6a7e70]
2017-03-08 14:22:54.732 Error: /home/pi/domoticz/domoticz(_ZN7Plugins11CImage_initEPNS_6CImageEP7_objectS3_+0x21c)

Here is my implementation:
https://github.com/tester22/Domoticz-So ... 8ecc29c921

Any idea what might be causing this?

Re: Using CustomImages with the Python framework

Posted: Thursday 09 March 2017 11:14
by Dnpwwo
@tester22,

I've used it on Windows and Linux and it seemed fine so platform shouldn't be an issue.

Can you request a log with debug turned on? May add logging around the Images based lines?