We have moved at community.getvera.com

Author Topic: firmware 1.5.408 and plugin icons  (Read 5233 times)

Offline sb_domo

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
firmware 1.5.408 and plugin icons
« on: July 12, 2012, 03:52:51 am »
Hello,
There are changes in the management of the icons of plugins.

I noted that is needed a new section in the json file of that type:
Code: [Select]
"state_icons": [
        "myicon_0.png",
        "myicon_100.png"
    ],

However, I have another two problems:
With the ancient firmware, it was possible to make download the icons by the plugin since an external url with that configuration:
Code: [Select]
    "flashicon": "http://url/myicon.png",
    "imgIconMin": "http://url/myicon_0.png",
    "imgIconMax": "http://url/myicon_100.png",
This does not work any more. The local path of icons is added to the url and there is an error 404.
What would be the best method to put personalized icons in a plugin?

The second problem concerns plugins updated as, for example, "Virtual ON/OFF ON/OFF Switches" or "Variable Container" : the update (with the new section is json file) allows to see icons on the local UI v. 1.5.408 but they do not appear by way of the proxy of mios.

Any solution ?

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
firmware 1.5.408 and plugin icons
« Reply #1 on: July 12, 2012, 04:34:03 am »
What would be the best method to put personalized icons in a plugin?

Take a look in the Heliotrope plugin. All of the images are hosted on futzle.com.

Offline sb_domo

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: firmware 1.5.408 and plugin icons
« Reply #2 on: July 12, 2012, 05:13:29 am »
Take a look in the Heliotrope plugin. All of the images are hosted on futzle.com.
Hello,
I go to see your json file :
Code: [Select]
{
"flashicon": "http://www.futzle.com/mios/Heliotrope_32x32.png",
"imgIconBody": "",
"imgIconDimmable": "",
"imgIconTurnable": "",
"imgIconMin": "",
"imgIconMax": "",
"halloIconsDir": "pics\/hallo",
"inScene": "0",
"state_icons": [
"Heliotrope_32x32_0.png",
"Heliotrope_32x32_25.png",
"Heliotrope_32x32_50.png",
"Heliotrope_32x32_-25.png",
"Heliotrope_32x32_-50.png"
],
It has the same structure that I talked about in my post :
Code: [Select]
flashicon": "http://url/myicon.png",and the "state_icons" section.
But in the new firmware, this doesn't work for me.


Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: firmware 1.5.408 and plugin icons
« Reply #3 on: July 12, 2012, 05:17:39 am »
For compatibility reasons with older firmwares, do we have to keep imgIconMin and imgIconMax filled or not ?

Offline sb_domo

  • Sr. Newbie
  • *
  • Posts: 42
  • Karma: +0/-0
Re: firmware 1.5.408 and plugin icons
« Reply #4 on: July 12, 2012, 05:25:54 am »
Yes,
Your question is important.
I found why I have a problem that is not in Heliotrope plugin.

The two line :
Code: [Select]
    "imgIconMin": "http://url/myicon_0.png",
    "imgIconMax": "http://url/myicon_100.png",
Must be :
Code: [Select]
    "imgIconMin": "myicon_0.png",
    "imgIconMax": "myicon_100.png",
Or
Code: [Select]
    "imgIconMin": "",
    "imgIconMax": "",
Or perhaps, that lines have not to be kept...

Edit : And for my second problem. When I give an external url for the icons, the UI when I use mios proxy show my icons...
« Last Edit: July 12, 2012, 05:35:04 am by sb_domo »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
firmware 1.5.408 and plugin icons
« Reply #5 on: July 12, 2012, 05:44:35 am »
I'm pretty sure that those two JSON keys are not used in UI4 or UI5. I've made plugins that don't include them and they don't seem to have a problem.

No idea on the remote access issue; I don't use it.

Offline lolodomo

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3484
  • Karma: +74/-10
Re: firmware 1.5.408 and plugin icons
« Reply #6 on: July 12, 2012, 05:59:05 am »
This is what is mentioned in the WiKi: no effect.

http://wiki.micasaverde.com/index.php/Luup_plugins:_Static_JSON_file

Quote
imgIconBody
A string which appears to have no effect.
imgIconDimmable
A string which appears to have no effect.
imgIconTurnable
A string which appears to have no effect.
imgIconMin
A string which appears to have no effect.
imgIconMax
A string which appears to have no effect.


And nothing is filled for example in the temperature sensor.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
firmware 1.5.408 and plugin icons
« Reply #7 on: July 12, 2012, 06:01:23 am »
Yes, I wrote that wiki page based on what I knew at the time, reverse-engineering static JSON files. It clearly contains errors. It's definitely not authoritative.

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: firmware 1.5.408 and plugin icons
« Reply #8 on: July 12, 2012, 09:37:27 am »
The imgIcon... tags were used only in UI3. In UI4 and UI5 they are ignored.

Offline automator.app

  • Sr. Member
  • ****
  • Posts: 307
  • Karma: +2/-1
firmware 1.5.408 and plugin icons
« Reply #9 on: July 12, 2012, 07:59:05 pm »
The imgIcon... tags were used only in UI3. In UI4 and UI5 they are ignored.

Why not remove all the obsolete tags?  It's not like the device files are at all backwards compatible.  They just add bloat and confusion to all the plugin developers and remote applications.
Automator.app is dead.

Offline mcvflorin

  • Administrator
  • Hero Member
  • *****
  • Posts: 1755
  • Karma: +11/-3
Re: firmware 1.5.408 and plugin icons
« Reply #10 on: July 13, 2012, 05:17:58 am »
@automator.app

There are plans to clean those files, but those are low in the priority list.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3260
  • Karma: +192/-9
firmware 1.5.408 and plugin icons
« Reply #11 on: July 13, 2012, 05:44:12 am »
Meanwhile, it's a wiki, knock yourselves out fixing the pages.