Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for las vegas layout #316

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
492 changes: 1 addition & 491 deletions formulaone-card.js

Large diffs are not rendered by default.

Binary file modified formulaone-card.js.gz
Binary file not shown.
374 changes: 344 additions & 30 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formulaone-card",
"version": "1.8.8",
"version": "1.8.9",
"description": "Frontend card for Home Assistant to display Formula One data",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -31,6 +31,8 @@
"eslint": "^8.52.0",
"home-assistant-js-websocket": "^9.1.0",
"lit": "^3.0.2",
"lit-element": "^3.3.3",
"minify-html-literals-loader": "^1.1.1",
"typescript": "^4.9.5",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4"
Expand All @@ -47,6 +49,7 @@
"jest-environment-jsdom": "^29.6.2",
"jest-fetch-mock": "^3.0.3",
"jest-ts-auto-mock": "^2.1.0",
"minify-html-literals-loader": "^1.1.1",
"ts-auto-mock": "^3.6.4",
"ts-jest": "^29.1.1",
"ts-loader": "^9.5.0",
Expand Down
2 changes: 1 addition & 1 deletion src/directives/action-handler-directive.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/* istanbul ignore file */
import { noChange } from 'lit';
import { AttributePart, directive, Directive, DirectiveParameters } from 'lit/directive.js';
import { ActionHandlerDetail, ActionHandlerOptions } from 'custom-card-helpers/dist/types';
import { fireEvent } from 'custom-card-helpers';
import { ActionHandlerElement } from '../types/formulaone-card-types';
import { noChange } from 'lit-element';

const isTouch = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.maxTouchPoints > 0;

Expand Down
5 changes: 2 additions & 3 deletions src/editor.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { css } from "lit";
import { html, TemplateResult } from "lit-html";
import { customElement } from 'lit/decorators.js';
import { CARD_EDITOR_NAME } from "./consts";
import { CountdownType, FormulaOneCardType, PreviousRaceDisplay, WeatherUnit } from "./types/formulaone-card-types";
import EditorForm from '@marcokreeft/ha-editor-formbuilder'
import { FormControlType } from "@marcokreeft/ha-editor-formbuilder/dist/interfaces";
import { getDropdownOptionsFromEnum } from "@marcokreeft/ha-editor-formbuilder/dist/utils/entities";
import { css, CSSResult, customElement } from "lit-element";

@customElement(CARD_EDITOR_NAME)
export class FormulaOneCardEditor extends EditorForm {
Expand Down Expand Up @@ -93,7 +92,7 @@ export class FormulaOneCardEditor extends EditorForm {
]);
}

static get styles() {
static get styles() : CSSResult {
return css`
.form-row {
margin-bottom: 10px;
Expand Down
2 changes: 1 addition & 1 deletion src/types/formulaone-card-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ActionConfig, ActionHandlerOptions, HomeAssistant, LovelaceCardConfig } from 'custom-card-helpers';
import { HTMLTemplateResult } from 'lit';
import { HTMLTemplateResult } from 'lit-element';

export interface FormulaOneCardConfig extends LovelaceCardConfig {
show_icon?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const getCircuitName = (location: Location) => {
circuitName = exception[0].name;
}

if(location.country == 'USA' && location.locality != 'Austin')
if((location.country == 'USA' || location.country == 'United States') && location.locality != 'Austin')
{
circuitName = location.locality;
circuitName = location.locality.replace(" ","_");
}

if(location.country == 'Italy' && location.locality == 'Imola')
Expand Down
6 changes: 6 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ module.exports = {
},
},
},
{
test: /\.(js|jsx|ts|tsx)$/,
use: [
{ loader: 'minify-html-literals-loader' }
],
},
{ test: /\.tsx?$/, loader: "ts-loader" }
],
},
Expand Down
Loading