kbrown01 / sportstandingsscores Goto Github PK
View Code? Open in Web Editor NEWSports Standings and Scores Sensors and Dashboard for Home Assistant
Sports Standings and Scores Sensors and Dashboard for Home Assistant
First I will admit I have no idea what I am doing. I am trying to add just a simple NFL standings card
I followed what you have and added in the config:
Then I followed what you have for the NFL standings card:
type: custom:flex-table-card
title: NFL Standings
sort_by: entries-
entities:
include: sensor.nfl_standings
columns:
But I keep getting the error "Cannot read properties of undefined (reading 'find')"
Just wanted to say this is truly amazing work! Great job. Is there a better way to contact you?
ESPN stats started returning "CLINCHER" object in JSON, but only for those teams who have clinched.
This screwed up indexing the fields.
Two solutions implemented for this for NHL only now, will implement the change in other sports.
First, the proper way to grab a field is by "abbreviation" and not positional index.
This assumes that ESPN will not change the abbreviation for particular stats (doubtful).
This is done using .find. FOr example for the attribute Games Played (GP):
- name: GP
data: entries
modify: x.stats.find(y=>y.abbreviation == 'GP').displayValue
The second was to handle when an object does not exist without error in the flex-table.
This only occurs for CLINCH I would think. it could be made as a generic change across all attributes, but implemented now for only CLINCH.
- name: C
data: entries
modify: if(typeof x.stats.find(y=>y.abbreviation == 'CLINCH') !== 'undefined' ){x.stats.find(y=>y.abbreviation == 'CLINCH').displayValue}else{'-'}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.