Skip to content

Commit

Permalink
Fix for las vegas layout (#316)
Browse files Browse the repository at this point in the history
* Fix for las vegas layout

* Version up and minify
  • Loading branch information
marcokreeft87 committed Nov 16, 2023
1 parent 3d57dd7 commit f6f2530
Show file tree
Hide file tree
Showing 9 changed files with 361 additions and 529 deletions.
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

0 comments on commit f6f2530

Please sign in to comment.