How to show custom (python) content?
#1
Hi All,

I've been searching around the web for some time now but with no luck yet.
I'm making a specific skin for 7" in car use.

Skin is used on raspberry pi with canbus module. This canbus module is able to read the speed of the car.
I'm planning to print this speed somewhere next to Kodi's time or weather controls, but haven't figured out yet how to interface a Python var to a Kodi label / item.

Does anyone know if it is somehow possible to us some kind of: <label>$INFO[pythonvar]</label>.
It does not mather if I have to specify the control / label, or maybe use an string ID which could be overwritten...
Though it needs to be able to refresh often < 0,5 sec)

(I've tried the xbmcgui tutorial with the controllabel / addlabel options but this creates a complete black -new- window.)

Thanks in advance!
Jeroen
Reply
#2
you can use window properties to communicate from python to the gui.
in your addon use:
Code:
xbmcgui.Window(10000).setProperty(speed, str(value))

then in your skin, use:
Code:
$INFO[Window(Home).Property(speed)]

whenever you update the property in your python code, it will be refreshed in the skin as well.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Hi Ronie,

That was exactly what I was looking for, works perfectly (tested locally with counter)!!
Thanks so much!
Reply
#4
Hi Jeroen. Would you help a newbie and post the complete .py that is necessary to update said property? Thanks in advance :-)
Reply

Logout Mark Read Team Forum Stats Members Help
How to show custom (python) content?0