Jump to content


Photo

NEW plugin: InfoBarWeather


  • Please log in to reply
38 replies to this topic

#1 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 2 August 2022 - 20:53

Here is a new plugin that shows the weather in the infobar:

  • Location
  • Last update time
  • Sunrise
  • Sunset
  • Humidity
  • 2 hour rain forecast (The Netherlands & Belgium only)
  • Wind direction and speed
  • Temperature
  • Apparent (feel) temperature

It has built-in support for PLi-FullNightHD and PLi-FullHD skins.

 

What do you think?

 

enigma2-plugin-extensions-infobarweather_all.ipk

 

Attached File  infobarweather.jpg   236.4KB   9 downloads


Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #2 Heppieboeddah

  • Senior Member
  • 455 posts

+7
Neutral

Posted 3 August 2022 - 08:04

Mooie bescheiden weerinfobar. Hier valt wel de temp wat weg. Niet volledig in beeld.

 

Zou mooi zijn als deze ook in Loui zijn skin geïmplementeerd zou kunnen worden.... :)

 

 

Attached Files


VU+ Uno 4K SE [DVB-C]


Re: NEW plugin: InfoBarWeather #3 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 3 August 2022 - 12:46

Nog beter het 'functie jatten' aan te passen in instantiate screens te maken waarmee de plugin zich aanmeld... Dan werkt dit gewoon in ELKE skin zonder extra renderers en zo.

 

Als deze op e2openplugins komt of zo dan kan ik kijken of het me lukt eraan te werken.


Edited by littlesat, 3 August 2022 - 12:46.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #4 Frenske

  • Forum Moderator
    PLi® Core member
  • 26,542 posts

+349
Excellent

Posted 3 August 2022 - 13:51

@Littlesat

It might be better to respond in English as this is preferable an English topic to reach more people.


Mijn schotel is een T90 met 10 LNB's. Daarnaast voor de fun nog een draaibaar systeem met een Triax TD 78.

Dreamboxen heb ik niet meer echt actief. Verder heb ik ook nog een een VU+ duo2 met 500Gb harddisk + een VU+ Uno, Zero, Solo 4K, Ultimo 4K, Zero 4K, Uno 4Kse. + ook nog een Xtrend ET7x00. Daarnaast heb ik ook nog diverse andere modellen w.o. een Formuler F4, ET8500, ET7500, Mut@nt 2400HD, Xsarius Fusion HD se en verder nog wel het e.e.a. waarmee op verzoek vanalles wordt getest. Iemand moet het tenslotte doen. ;) :)
Los van de eerder genoemde modellen heb ik nog wel een rits aan testsamples als Mut@nt 2400HD, HD60, GB UE4K, GB Trio4K, Maxitec Multibox combo en Twin, Octagon sf8008, sf8008 mini en last but nog least enkele modellen van het Grieks Duitse Edision.

Voor centrale opslag van media gebruik ik een Qnap 219P 
met tweemaal 2 Tb harddisks + een Synology DS414 met 12 Tb Totale opslag.

-------------------------------------------------------------------------------------------
Many answers to your question can be found in our wiki: Just one click away from this "solutioncentre".

Als ik alles al wist hoefde ik ook niets te vragen. If I had all the knowledge I had no questions at all.


Re: NEW plugin: InfoBarWeather #5 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 3 August 2022 - 14:28

Hooked by the second post....

 

I see you 'steal' functions for the infobar from infobargenerics.py which is actually a dirty work-a-round. Maybe better we should add a plugin type that can add instantiate screens to the inforbar for these kind of functionality. Then every skin could have extra information without a real requirement to add renderers to a skin.

 

The idea is to add a type of plugin that can add instantiate screens to the infobar, secondinfobar, menuscreen etc.... but to arrange this code needs to be added in e.g. infobargenerics so it take a list of the plugins and then add the instantiate screen....

 

Maybe we need to consider to add this plugin to e2openplugins... and maybe when I find time and find sufficient concentration I can try to make these changes.... (also other plugins can make use of it)


Edited by littlesat, 3 August 2022 - 14:37.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #6 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 3 August 2022 - 14:38

I 'stole' from recordinfobar :-)
Yes, a generic solution would be preferable. One where network access wouldn't delay rendering.

Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #7 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 3 August 2022 - 14:54


One where network access wouldn't delay rendering.

 

I see indeed you can have a delay...

 

You can also do it in a thread style when you use twisted.web.client instead of Urllib. Like I tried here https://github.com/O...b784ece68558fba but at that time I needed to revert it for the ImportChannels.py due to it triggered a big bug in the epgcache (which in between is fixed, but someone did add something for DVB-T tuners that broke it).

 

Then you need to cache the info and but it e.g. in a thread... but it will then you always 'ping' a weather website once in a while... when you do it on demand and cache you can also consider to show shortly old info.

Steal function is sensitive for 'changes'... so when someone make changes in InfoBarGenerics it may lead to crashes.... Actually this is not done... 
 


Edited by littlesat, 3 August 2022 - 14:58.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #8 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 3 August 2022 - 21:39

 

One where network access wouldn't delay rendering.

I see indeed you can have a delay...
 
You can also do it in a thread style when you use twisted.web.client instead of Urllib.

 

Yes, twisted.web would be the way, reactor is running anyway. Also no extra thread needed.
 

Then you need to cache the info and but it e.g. in a thread... but it will then you always 'ping' a weather website once in a while... when you do it on demand and cache you can also consider to show shortly old info.

The current implementation does that (on demand fetch and show no info shortly). It is unavoidable with on demand fetch to shortly show old/no info.
 
Pinging the weather website periodically is unacceptable, that would mean the site is pinged all the time while watching a long movie with no infobar showing for a long time.
 

Steal function is sensitive for 'changes'... so when someone make changes in InfoBarGenerics it may lead to crashes.... Actually this is not done... 

The current hack is quite clean (it is still monkey-patching, which should be avoided if possible). It does two things: replace InfoBar.__init__, with the replacement calling the original __init__, and hooking into the InfoBar onShow/onHide chains. The latter is unavoidable imho if you want to fetch on demand (and isn't it what these chains are there for?). Neither InfoBar.__init__, nor onShow/onHide is likely to be removed in the near future, if ever.

 

How about this then: create the plugin Screen in the plugin's WHERE_AUTOSTART/WHERE_SESSIONSTART (eliminates the need for the __init__ monkey-patch), and have a Renderer and a Source. The Source hooks into InfoBar onShow/onHide, shows or hides the plugin Screen with it, fetches weather data on onShow when stale (cache too old) with twisted.web and kicks the Renderer (call changed()) upon the twisted.web success callback?


Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #9 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 4 August 2022 - 08:56


Yes, twisted.web would be the way, reactor is running anyway. Also no extra thread needed.

 

Is this something you are able to adapt. 

 

 

 

Pinging the weather website periodically is unacceptable, that would mean the site is pinged all the time while watching a long movie with no infobar showing for a long time.

 

Maybe we should think about a smart way... cache the weather info for 1 hour and when you do not 'zap' then do it once after one hour..... so most times you always got a hit..

 

 

 

monkey-patching

 

I think this is not done... But it was born due to back in 2008 or so Dream Multimedia was not willing to adapt,  I had for long time the idea to create a INSTANTIATE_SCREEN plugin type and adapt the code so instantiate screens could be shown... At this moment I have since a surgery in 2021 issues with concentration and all my energy goes to my daily work... When I find rest I can look at this. 

Also working with two persons together on one source code is not done... So I hope you're willing to try twisted and then later I can try to find a way to do it with instantiate screens.--- just to 'remove the monkey'


Edited by littlesat, 4 August 2022 - 08:56.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #10 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 4 August 2022 - 19:15

 

Yes, twisted.web would be the way, reactor is running anyway. Also no extra thread needed.

Is this something you are able to adapt.

Yes. I replaced urllib with (twisted.web based) Tools.downloadWithProgress.
 

So I hope you're willing to try twisted and then later I can try to find a way to do it with instantiate screens.--- just to 'remove the monkey'

That would be great :)
 

Hier valt wel de temp wat weg. Niet volledig in beeld.

You mean the wind speed? Fixed.
 

Zou mooi zijn als deze ook in Loui zijn skin geïmplementeerd zou kunnen worden.... :)

The latest version adds support for Loui's skin. Just make sure you delete all locations from the weather plugin.

Please reinstall from the link in post #1.


Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #11 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 4 August 2022 - 21:13

:)

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #12 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 4 August 2022 - 22:48

v0.4.

 

Fixed a bug where weather data would not appear in the infobar.

 

Please reinstall from the link in post #1.


Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #13 Dimitrij

  • PLi® Core member
  • 8,736 posts

+290
Excellent

Posted 5 August 2022 - 05:41

Just for information...

[Bitrate] Improvize plugin (add infobar mode)


Duo 4K/Lunix3-4K/Solo 4K


Re: NEW plugin: InfoBarWeather #14 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 5 August 2022 - 09:05


Just for information...

 

Nice idea.... it triggered via evStart etc... But it has an independed timeout as it does not hide when the infobar is going to hide...

 

But it brings me to an alternative idea... But the idea (may) need (also) a modification in InfoBarGenerics... and maybe it is already there in the screens class or so...

 

This is to add a function that is executed when the infobar is shown or hidden... that also calls a function in the plugin that arrange the hide and hidden from bitrate alias weather screen.... and then maybe also needed let the plugin add the instantiate screen on Infobar... the Infobar is available via session!....


Edited by littlesat, 5 August 2022 - 09:05.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #15 Loui (PD1LOI)

  • Senior Member
  • 4,151 posts

+112
Excellent

Posted 5 August 2022 - 15:09

Attached File  1_0_19_4AF7_840_600_FFFF0000_0_0_0_20220805160014.png   1.46MB   1 downloads  If this icon could remain in space, it would remain complete. The plugin adjustment in the skin is arranged in this way.

 



Re: NEW plugin: InfoBarWeather #16 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 5 August 2022 - 15:16

I prefer the small icons.... it would indeed be 'nice' and more multifunctional when you can re-locate the weather 'bar'... so you can change the x,y offset position... this might make it compatible somehow for any skin.

 

Of course as far I understand it is a separate screen.. so a skinner should be able to adapt that specific screen... except for a the weather icon... All icons are included in the plugin. What I understand os that Loui is asking for a big weather icon.


Edited by littlesat, 5 August 2022 - 15:18.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #17 scriptmelvin

  • Senior Member
  • 229 posts

+12
Neutral

Posted 5 August 2022 - 16:18

If this icon could remain in space, it would remain complete. The plugin adjustment in the skin is arranged in this way.

The "bar" could indeed be shortened so that the icon is completely visible. This plugin was meant for the people for whom the weather plugin doesn't work anymore. And in that case all locations should be removed from the weather plugin, then the big icon isn't there anymore.

 

Of course as far I understand it is a separate screen.. so a skinner should be able to adapt that specific screen...

Yes, completely skinnable. Use /tmp/InfoBarWeather/skin.xml as a starting point and put it in skin_user.xml.


Vu+ Uno 4K SE CD Triple LNB Quad Triax TDS64 OpenPLi 8.2-release 2022-06-05


Re: NEW plugin: InfoBarWeather #18 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 5 August 2022 - 18:00

And of course you can put the screen in the skin.

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: NEW plugin: InfoBarWeather #19 Loui (PD1LOI)

  • Senior Member
  • 4,151 posts

+112
Excellent

Posted 6 August 2022 - 07:58

I've adjusted it slightly, the layout is a bit bigger, it looks better. I left the picon of the "WeatherPlugin" standing. it could transfer to SweaterInfobar. But I wouldn't know how to do that myself. Attached File  1_0_19_4ABA_80B_600_FFFF0000_0_0_0_20220806085729.jpg   112.39KB   4 downloads

 

<screen name="%(screen_name)s" position="384,845" size="1336,51" backgroundColor="#ff000000" zPosition="2" flags="wfNoBorder">
<!-- SKINNERS: enable at most one of the following two lines -->
<!--<widget name="infoBarBackground" position="0,0" size="1336,51" zPosition="-1" backgroundColor="#ff000000" />-->
<widget name="infoBarBackground" position="0,0" size="1336,51" zPosition="-1" alphatest="off" pixmap="%(imageDir)s/PLi-FullNightHD-background.png" />
 
<!-- SKINNERS: enable at most one of the following two lines -->
<widget name="secondInfoBarBackground" position="0,0" size="1336,51" zPosition="-1" backgroundColor="%(secondInfoBarBackgroundColor)s" />
<!--<widget name="secondInfoBarBackground" position="0,0" size="1336,51" zPosition="-1" alphatest="off" pixmap="" />-->
 
<widget name="notconfigured" position="18,0" size="1096,45" valign="center" halign="center" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="regio" position="18,0" size="337,45" valign="center" halign="right" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="time" position="360,0" size="70,45" valign="center" halign="left" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="sunrise" position="450,0" size="80,45" valign="center" halign="right" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="sunrisesetPixmap" position="538,7" size="50,28" alphatest="blend" pixmap="%(imageDir)s/sunriseset.png" />
<widget name="sunset" position="595,0" size="80,45" valign="center" halign="left" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="humidityPixmap" position="698,7" size="28,28" alphatest="blend" pixmap="%(imageDir)s/droplet.png" />
<widget name="humidity" position="728,0" size="80,45" valign="center" halign="left" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="winddirectionMultiPixmap" position="915,7" size="28,28" alphatest="blend" pixmaps="%(windPixmaps)s" />
<widget name="beaufort" position="948,0" size="112,45" valign="center" halign="left" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="windspeedms" position="948,0" size="200,45" valign="center" halign="left" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="weatherPixmap" position="1065,7" size="28,28" alphatest="blend" />
<widget name="temperature" position="1107,0" size="80,45" valign="center" halign="right" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
<widget name="feeltemperature" position="1175,0" size="80,45" valign="center" halign="right" foregroundColors="#00B6B6B6,#29abe2,#ff5555" backgroundColor="#18101214" font="Regular; 28" transparent="1" />
%(rainWidgets)s
<widget name="zero" position="820,30" size="12,14" valign="top" halign="center" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 11" transparent="1" />
<widget name="one" position="844,30" size="12,14" valign="top" halign="center" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 11" transparent="1" />
<widget name="two" position="868,30" size="12,14" valign="top" halign="center" foregroundColor="#00B6B6B6" backgroundColor="#18101214" font="Regular; 11" transparent="1" />
</screen>

Edited by Loui (PD1LOI), 6 August 2022 - 08:00.


Re: NEW plugin: InfoBarWeather #20 littlesat

  • PLi® Core member
  • 53,884 posts

+641
Excellent

Posted 6 August 2022 - 08:45

Why don’t you just put the screens in the skin?


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users