Code Monkey home page Code Monkey logo

formulaone-card's Introduction

FormulaOne Card

GH-release GH-last-commit GH-code-size hacs_badge Codecov Coverage CodeFactor

Present the data of Formula One in a pretty way

Installation

Use this button: Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

OR Manually add formulaone-card.js to your <config>/www/ folder and add the following to the configuration.yaml file:

lovelace:
  resources:
    - url: /local/formulaone-card.js
      type: module

OR install using HACS and add this (if in YAML mode):

lovelace:
  resources:
    - url: /hacsfiles/formulaone-card/formulaone-card.js
      type: module

The above configuration can be managed directly in the Configuration -> Lovelace Dashboards -> Resources panel when not using YAML mode, or added by clicking the "Add to lovelace" button on the HACS dashboard after installing the plugin.

Configuration

Name Type Default Description
type string Required custom:formulaonecard
card_type string Required The type of card you want to display (driver_standings,constructor_standings,next_race,schedule,last_result,results,countdown)
title string The header of the card ( hidden when null or empty)
date_locale string Override the locale used for the date and time formatting
image_clickable boolean false Click on image leads to wikipedia, or not
show_carnumber boolean false Show the number of the car
location_clickable boolean false Click on the location leads to wikipedia
previous_race enum Hide/strikethrough or make the past races italic options are (hide, strikethrough or italic)
standings object Configuration for the driver standings card
translations dictionary translations Dictionary to override the default translation
type: custom:formulaone-card
card_type: next_race
title: Next Race
date_locale: nl
image_clickable: false

image

type: custom:formulaone-card
card_type: constructor_standings
title: Constructor Standings

image

type: custom:formulaone-card
card_type: driver_standings
title: Driver Standings

image

This card can also show the flags and team names of the driver:

type: custom:formulaone-card
card_type: driver_standings
title: Driver Standings
standings:
  show_flag: true
  show_team: true
  
type: custom:formulaone-card
card_type: schedule
title: Schedule
date_locale: nl

image

type: custom:formulaone-card
card_type: last_result
title: Last Result

image

type: custom:formulaone-card
card_type: results
title: Results

image

type: custom:formulaone-card
card_type: countdown

image

Translations

The following texts can be translated or altered.

Card type(s) Key Default value
next_race, schedule date 'Date'
next_race practice1 'Practice 1'
next_race practice2 'Practice 2'
next_race practice3 'Practice 3'
next_race, schedule race' 'Race'
next_race racename 'Race name'
next_race circuitname 'Circuit name'
next_race, schedule location' 'Location'
next_race city 'City'
next_race racetime 'Race'
next_race sprint 'Sprint'
next_race qualifying 'Qualifying'
next_race, schedule endofseason 'Season is over. See you next year!'
constructor_standings constructor 'Constructor'
constructor_standings, driver_standings, last_result points 'Pts'
constructor_standings, driver_standings wins 'Wins'
driver_standings team 'Team'
driver_standings, last_result driver 'Driver'
last_result grid 'Grid'
last_result status 'Status'
schedule time 'Time'
results raceheader 'Race'
results seasonheader 'Season'
results selectseason 'Select season'
results selectrace 'Select race'
results noresults 'Please select a race thats already been run'
countdown days 'd'
countdown hours' : 'h'
countdown minutes' : 'm'
countdown seconds' : 's'

Example:

type: custom:formulaone-card
card_type: next_race
title: Next Race
date_locale: nl
image_clickable: true
translations: 
  'date' : 'Date'  
  'practice1' : 'Practice 1'
  'practice2' : 'Practice 2'
  'practice3' : 'Practice 3'
  'race' : 'Race'
  'racename' : 'Race name'
  'circuitname' : 'Circuit name'
  'location' : 'Location'
  'racetime' : 'Race'
  'sprint' : 'Sprint'
  'qualifying' : 'Qualifying'
  'endofseason' : 'Season is over. See you next year!!'

TODO

  • Convert Ergast client to use fetch to reduce library size
  • Use F1 font

formulaone-card's People

Contributors

dependabot[bot] avatar marcokreeft87 avatar phpersson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.