It is currently July 7th, 2020, 2:22 am

SmallWeather - work in progress

Post your work-in-progress and completed skins to share and discuss.
ms310
Posts: 224
Joined: April 1st, 2015, 7:16 am

SmallWeather - work in progress

Post by ms310 »

This skin is heavily modified from work by Eclectic-tech and Xenium. Help over the years from Balala, POIRU, and JSMORLEY has helped me get this far.
THIS IS A WORK IN PROGRESS - it works, but the icons may not all be correct. See below for reporting mismatches and I will fix them.
This weather skin uses isitraining.in for the weather feed. It also uses http://worldtimeapi.org/api/timezone for the timezone info. Most of the icons are created by me - I am slowly substituting them for the default icon set.

Limitations
  • Only Supports Celcius
  • Some weather icons might not match up - if the icons look strange or are missing for your weather status send me the small number in the lower left of the skin along with the text description of the weather
Usage
  • Click the weather description to hide the background and the timezones
  • Edit variables (right-click skin, edit variables) to change the weather location and timezones
    The first timezone is meant to be your HOME timezone - I often (well, before COVID) travel outside of my own timezone so I decided to style this a little differently.
  • This plugin uses Chameleon and the area right under the skin to set the colors. It trys to do a good job. If you want to set the colors yourself look in the Styles.inc file.
  • When it is "hot" a small thermometer will appear. When it is REALLY HOT a different thermometer will appear. Same for cold. When it is raining an umbrella icon will appear.
Pic of the skin
skinpic.png
Icons made by me - I am slowly replacing them. The weather site doesn't use the standard numbering.
icons.png
You do not have the required permissions to view the files attached to this post.
ms310
Posts: 224
Joined: April 1st, 2015, 7:16 am

Re: SmallWeather - work in progress

Post by ms310 »

I would like some help - I want to map iconnames to numeric values. The website provides very detailed iconnames.

https://developer.here.com/documentation/destination-weather/dev_guide/topics/resource-type-weather-items.html

Search for iconName and you can see what I mean.

I would like to map these values - some of the values will have the same mapping - such as:

sunny: 1
clear: 1

I know I can do a substitute - but I am wondering if there is a better way to make the code more readable - maybe in LUA?

Thanks for any ideas!
User avatar
jsmorley
Developer
Posts: 20995
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SmallWeather - work in progress

Post by jsmorley »

ms310 wrote:
June 12th, 2020, 12:13 pm
I would like some help - I want to map iconnames to numeric values. The website provides very detailed iconnames.

https://developer.here.com/documentation/destination-weather/dev_guide/topics/resource-type-weather-items.html

Search for iconName and you can see what I mean.

I would like to map these values - some of the values will have the same mapping - such as:

sunny: 1
clear: 1

I know I can do a substitute - but I am wondering if there is a better way to make the code more readable - maybe in LUA?

Thanks for any ideas!
Lua might be one solution for this, basically you just create a "table" (array) of the icon names, and then return the "index number" of the table when you pass it the "icon name".

Another option is to create a .inc file that you @Include, that just contains a [Variables] section like:

[Variables]
sunny=1
clear=2
mostly_sunny=3
mostly_clear=4
passing_clounds=5

Then you just reference the number as [#[&MeasureName]]. So you "nest" the measure returning the icon name to get the value for the variable. Be sure to use DynamicVariables=1 on this.

So when the value of [MeasureName] is "mostly_sunny", [#[&MeasureName]] would return "3".
ms310
Posts: 224
Joined: April 1st, 2015, 7:16 am

Re: SmallWeather - work in progress

Post by ms310 »

Yes please! If you could mock something up with a few entries that are unique and a few not unique I could fill out the rest of the table with my icons.

I’m my skin I have a weathermeasures.inc file that is referenced by the main skin that does the display.

Thanks for any help or guidance!

Mike
User avatar
jsmorley
Developer
Posts: 20995
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SmallWeather - work in progress

Post by jsmorley »

ms310 wrote:
June 12th, 2020, 12:48 pm
Yes please! If you could mock something up with a few entries that are unique and a few not unique I could fill out the rest of the table with my icons.

I’m my skin I have a weathermeasures.inc file that is referenced by the main skin that does the display.

Thanks for any help or guidance!

Mike
Check my edit to see if maybe just using a .inc file might not be easier.

I can still do the Lua, but this might be easier for you to implement.
User avatar
jsmorley
Developer
Posts: 20995
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SmallWeather - work in progress

Post by jsmorley »

Using the @Include approach is certainly going to be simpler if you want both "sunny" and "clear" to return the same icon number. You wouldn't be able to do that with a simple table/index lookup in Lua, you would need something a tad more involved. Not rocket science, but instead of a single-column table that simply returns the index of the table, you would need two columns, "name" and "number". Then you return "number" when you are passed "name".

While I'm a huge fan of Lua, I don't think using it in this particular case is any more efficient, or is any less "code". The bulk of it is the "list", and you simply can't avoid that.
ms310
Posts: 224
Joined: April 1st, 2015, 7:16 am

Re: SmallWeather - work in progress

Post by ms310 »

jsmorley wrote:
June 12th, 2020, 12:59 pm
While I'm a huge fan of Lua, I don't think using it in this particular case is any more efficient, or is any less "code". The bulk of it is the "list", and you simply can't avoid that.
Thanks - I think [#[&MeasureName]] is a slick solution I didn’t know of. Thank you! I will get to work on this and my skin will hopefully make the list of working weather skins!

Cheers!
User avatar
jsmorley
Developer
Posts: 20995
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SmallWeather - work in progress

Post by jsmorley »

ms310 wrote:
June 12th, 2020, 1:22 pm
Thanks - I think [#[&MeasureName]] is a slick solution I didn’t know of. Thank you! I will get to work on this and my skin will hopefully make the list of working weather skins!

Cheers!
https://docs.rainmeter.net/manual/variables/nesting-variables/
ms310
Posts: 224
Joined: April 1st, 2015, 7:16 am

Re: SmallWeather - work in progress

Post by ms310 »

ありがとう! Thank you!
User avatar
jsmorley
Developer
Posts: 20995
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SmallWeather - work in progress

Post by jsmorley »

ms310 wrote:
June 12th, 2020, 1:30 pm
ありがとう! Thank you!
તમારું સ્વાગત છે !