Please login or register.

Login with username, password and session length

Author Topic: Sports Scores Widget  (Read 6156 times)

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Sports Scores Widget
« on: March 02, 2020, 01:40:06 PM »

I made another widget - this one for sports scores - that uses the NBS Sports scoreboard inside an iframe in the widget.  You can change the tool it uses if you wish but here is what it looks like out of the box:

Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #1 on: March 02, 2020, 03:20:31 PM »

I made another widget - this one for sports scores - that uses the NBS Sports scoreboard inside an iframe in the widget.  You can change the tool it uses if you wish but here is what it looks like out of the box:
Nice work  #:)
You should specify which attachment is the wiget(zip) file and which is the Program (HGX) file
I believe some modifications need to be done for the location of the ticker info as mine is off compared to yours using the default settings
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Sports Scores Widget
« Reply #2 on: March 02, 2020, 05:12:19 PM »

What happens if you refresh the browser page you have the widget on?  Does it align or not?   May be something with the screen resolution?   Do you know what yours is - I will have to take a look tomorrow.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #3 on: March 02, 2020, 05:53:03 PM »

I had tested a refresh prior to posting  this eas using windows edge browser but just test on my android phone with same results.
I'll have a look tomorrow as well to see if I can adjust the display here.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Sports Scores Widget
« Reply #4 on: March 03, 2020, 06:57:03 AM »

If you go into the Configure Widgets and pull up the sportsscores entry adn then click the Parameters (side note - not sure how to get the parameters to be accessible from the widget on a home page itself) what are the entries for Height and Width?

Height for mine is 40 and Width is 800
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #5 on: March 03, 2020, 08:16:43 AM »

In the program code(startup code) the lowest value for height slider is 100 I believe. I've changed that to 20 to allow me to enter your setting for height  as lowest it would  allow was a 100 height setting
Code: [Select]
.AddOption("SportsScores.Height","120","Height","slider:100:450:5")This still doesn't fix the issue for me
I redownloaded the files as I had changed so much now my display looks like this using your settings.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #6 on: March 03, 2020, 08:52:38 AM »

Ok seems your height settings changes the spacing above the scores I managed to get a display simular to yours with a few edits
in the Widget html I changed the height to 80 pix
Code: [Select]
<iframe scrolling="no" allowtransparency="true" frameborder="0"
                style="box-sizing: border-box; height: 80px; width: 100%;"
                id="sportsscores"
                src="blank.html">
        </iframe>
In the program I set the width to 1000 which displays the right arrow in the scores allowing you to scroll through the results.
I set my height to 60 so it centers the scores display
It may be possible you posted a old build and the edits I made are to an older build then what your using.
« Last Edit: March 03, 2020, 08:55:45 AM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Sports Scores Widget
« Reply #7 on: March 03, 2020, 09:24:40 AM »

If you change the number at the end of the URL link to match your width be it should fix the width part.

I had started at 1000 and switched to 800.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #8 on: March 03, 2020, 09:31:33 AM »

Yep your right. It appears I may have a test build here, widget and program say ver1
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Sports Scores Widget
« Reply #9 on: March 03, 2020, 09:39:47 AM »

The height thing was tricky too - the defined parameters fr height and width are for the iframe part, then I add some extra to those values for the overall width and height.  There is code in the JavaScript portion of the widget that does that.

I will check when I get a chance to make sure I uploaded the latest version too - may have been an older one (they are all still very 1 ).

Any idea how to get the Parameters to be able to be set on the actual widget?
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #10 on: March 03, 2020, 09:48:14 AM »

Any idea how to get the Parameters to be able to be set on the actual widget?
I'm actually new to playing with the widget coding as well.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: Sports Scores Widget
« Reply #11 on: March 03, 2020, 10:19:16 AM »

The height thing was tricky too - the defined parameters fr height and width are for the iframe part, then I add some extra to those values for the overall width and height.  There is code in the JavaScript portion of the widget that does that.

I will check when I get a chance to make sure I uploaded the latest version too - may have been an older one (they are all still very 1 ).

Any idea how to get the Parameters to be able to be set on the actual widget?

I know you’ve been doing a bit on widget development and I assume you are somewhat experienced in JS. I found this to be quite helpful for creating widgets and editing preconfigured ones https://genielabs.github.io/HomeGenie/#/develop/widgets . If you have particular questions regarding widget creation you have a number of experienced HG users over on the HomeGenie Club who I imagine could share their experiences with you.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #12 on: March 03, 2020, 11:03:15 AM »

Adding the icon to the widget is the easy part.  Looking at the light widget will give you the HTML code you just have to figure out the java on click function to open the modules Parameters in a popup.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Sports Scores Widget
« Reply #13 on: March 04, 2020, 01:53:45 PM »

Just had a though for the button on click settings. -:) What if you had HG open to the /hg/html/index.html#page_configure_interfaces page? Your Sports Scores program settings are there.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

soxfan1966

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 388
Re: Sports Scores Widget
« Reply #14 on: March 07, 2020, 09:50:13 AM »

I ended up getting this working and am just getting a chance to post the updated program and widget.

This is version 1.1 (the original was version 1)

Logged
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.