From d5bc523975b385f6017b2ebd0ad27235e087cc8c Mon Sep 17 00:00:00 2001 From: Marco Kreeft Date: Sat, 15 Oct 2022 12:16:44 +0200 Subject: [PATCH] Added booleans hiding races, link and carnumber (#13) --- README.md | 4 ++- formulaone-card.js | 41 +++++++++++++-------- formulaone-card.js.gz | Bin 17094 -> 17355 bytes package.json | 2 +- src/cards/base-card.ts | 3 +- src/cards/constructor-standings.ts | 6 ++-- src/cards/driver-standings.ts | 9 ++--- src/cards/last-result.ts | 13 +++---- src/cards/next-race.ts | 10 ++---- src/cards/schedule.ts | 20 ++++++----- src/consts.ts | 0 src/index.ts | 4 +-- src/styles.ts | 13 +++++++ src/types/formulaone-card-types.ts | 9 +++++ src/utils.ts | 7 +++- tests/cards/constructor-standings.test.ts | 9 ++--- tests/cards/driver-standings.test.ts | 9 ++--- tests/cards/schedule.test.ts | 42 ++++++++++++++++++++-- tests/lib/formate_date_time.test.ts | 22 +++++++----- tests/utils/getDriverName.test.ts | 26 ++++++++++++++ 20 files changed, 179 insertions(+), 70 deletions(-) create mode 100644 src/consts.ts create mode 100644 tests/utils/getDriverName.test.ts diff --git a/README.md b/README.md index 5330355..930ebcb 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,9 @@ or added by clicking the "Add to lovelace" button on the HACS dashboard after in | card_type | string | **Required** | The type of card you want to display (driver_standings,constructor_standings,next_race,schedule,last_result) | | 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 | | Click on image leads to wikipedia, or not | +| 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 | ``` type: custom:formulaone-card diff --git a/formulaone-card.js b/formulaone-card.js index 691d8b7..e4def53 100644 --- a/formulaone-card.js +++ b/formulaone-card.js @@ -1,5 +1,5 @@ /*! For license information please see formulaone-card.js.LICENSE.txt */ -(()=>{"use strict";var t={197:(t,e,r)=>{r.r(e),r.d(e,{DEFAULT_DOMAIN_ICON:()=>J,DEFAULT_PANEL:()=>Z,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>rt,DOMAINS_TOGGLE:()=>nt,DOMAINS_WITH_CARD:()=>X,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>i,STATES_OFF:()=>it,TimeFormat:()=>n,UNIT_C:()=>at,UNIT_F:()=>ot,applyThemesOnElement:()=>U,computeCardSize:()=>L,computeDomain:()=>j,computeEntity:()=>H,computeRTL:()=>B,computeRTLDirection:()=>W,computeStateDisplay:()=>Q,computeStateDomain:()=>q,createThing:()=>dt,debounce:()=>ht,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>ct,fixedIcons:()=>mt,formatDate:()=>u,formatDateMonth:()=>v,formatDateMonthYear:()=>g,formatDateNumeric:()=>h,formatDateShort:()=>p,formatDateTime:()=>A,formatDateTimeNumeric:()=>C,formatDateTimeWithSeconds:()=>E,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>Y,formatTime:()=>T,formatTimeWeekday:()=>P,formatTimeWithSeconds:()=>O,forwardHaptic:()=>gt,getLovelace:()=>Ct,handleAction:()=>wt,handleActionConfig:()=>bt,handleClick:()=>$t,hasAction:()=>At,hasConfigOrEntityChanged:()=>St,hasDoubleClick:()=>Et,isNumericState:()=>z,navigate:()=>_t,numberFormatToLocale:()=>V,relativeTime:()=>R,round:()=>K,stateIcon:()=>Dt,timerTimeRemaining:()=>I,toggleEntity:()=>yt,turnOnOffEntities:()=>xt,turnOnOffEntity:()=>vt});var i,n,a,o=function(){return o=Object.assign||function(t){for(var e,r=1,i=arguments.length;r0)return{value:Math.round(h),unit:"year"};var m=12*h+u.getMonth()-d.getMonth();if(Math.round(Math.abs(m))>0)return{value:Math.round(m),unit:"month"};var p=n/604800;return{value:Math.round(p),unit:"week"}}(t,r);return i?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(n.value,n.unit):Intl.NumberFormat(e.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};function I(t){var e,r=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var i=(new Date).getTime(),n=new Date(t.last_changed).getTime();r=Math.max(r-(i-n)/1e3,0)}return r}function F(){return(F=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;r.minimumFractionDigits=i,r.maximumFractionDigits=i}return r},Q=function(t,e,r,i){var n=void 0!==i?i:e.state;if("unknown"===n||"unavailable"===n)return t("state.default."+n);if(z(e)){if("monetary"===e.attributes.device_class)try{return Y(n,r,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return Y(n,r)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var a=q(e);if("input_datetime"===a){var o;if(void 0===i)return e.attributes.has_date&&e.attributes.has_time?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(o,r)):e.attributes.has_date?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),u(o,r)):e.attributes.has_time?((o=new Date).setHours(e.attributes.hour,e.attributes.minute),T(o,r)):e.state;try{var s=i.split(" ");if(2===s.length)return A(new Date(s.join("T")),r);if(1===s.length){if(i.includes("-"))return u(new Date(i+"T00:00"),r);if(i.includes(":")){var c=new Date;return T(new Date(c.toISOString().split("T")[0]+"T"+i),r)}}return i}catch(t){return i}}return"humidifier"===a&&"on"===n&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===a||"number"===a||"input_number"===a?Y(n,r):e.attributes.device_class&&t("component."+a+".state."+e.attributes.device_class+"."+n)||t("component."+a+".state._."+n)||n},J="mdi:bookmark",Z="lovelace",X=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],rt=["camera","configurator","history_graph","scene"],it=["closed","locked","off"],nt=new Set(["fan","input_boolean","light","switch","group","automation"]),at="°C",ot="°F",st="group.default_view",ct=function(t,e,r,i){i=i||{},r=null==r?{}:r;var n=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return n.detail=r,t.dispatchEvent(n),n},lt=new Set(["call-service","divider","section","weblink","cast","select"]),ut={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},dt=function(t,e){void 0===e&&(e=!1);var r=function(t,e){return i("hui-error-card",{type:"error",error:t,config:e})},i=function(t,e){var i=window.document.createElement(t);try{if(!i.setConfig)return;i.setConfig(e)}catch(i){return console.error(t,i),r(i.message,e)}return i};if(!t||"object"!=typeof t||!e&&!t.type)return r("No type defined",t);var n=t.type;if(n&&n.startsWith("custom:"))n=n.substr("custom:".length);else if(e)if(lt.has(n))n="hui-"+n+"-row";else{if(!t.entity)return r("Invalid config given.",t);var a=t.entity.split(".",1)[0];n="hui-"+(ut[a]||"text")+"-entity-row"}else n="hui-"+n+"-card";if(customElements.get(n))return i(n,t);var o=r("Custom element doesn't exist: "+t.type+".",t);o.style.display="None";var s=setTimeout((function(){o.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),ct(o,"ll-rebuild",{},o)})),o},ht=function(t,e,r){var i;return void 0===r&&(r=!1),function(){var n=[].slice.call(arguments),a=this,o=function(){i=null,r||t.apply(a,n)},s=r&&!i;clearTimeout(i),i=setTimeout(o,e),s&&t.apply(a,n)}},mt={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in mt)return mt[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var r=e.value||e,i=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return i===r;case"<=":return i<=r;case"<":return i=":return i>=r;case">":return i>r;case"!=":return i!==r;case"regex":return i.match(r);default:return!1}},gt=function(t){ct(window,"haptic",t)},_t=function(t,e,r){void 0===r&&(r=!1),r?history.replaceState(null,"",e):history.pushState(null,"",e),ct(window,"location-changed",{replace:r})},vt=function(t,e,r){void 0===r&&(r=!0);var i,n=j(e),a="group"===n?"homeassistant":n;switch(n){case"lock":i=r?"unlock":"lock";break;case"cover":i=r?"open_cover":"close_cover";break;default:i=r?"turn_on":"turn_off"}return t.callService(a,i,{entity_id:e})},yt=function(t,e){var r=it.includes(t.states[e].state);return vt(t,e,r)},bt=function(t,e,r,i){if(i||(i={action:"more-info"}),!i.confirmation||i.confirmation.exemptions&&i.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(i.confirmation.text||"Are you sure you want to "+i.action+"?")))switch(i.action){case"more-info":(r.entity||r.camera_image)&&ct(t,"hass-more-info",{entityId:r.entity?r.entity:r.camera_image});break;case"navigate":i.navigation_path&&_t(0,i.navigation_path);break;case"url":i.url_path&&window.open(i.url_path);break;case"toggle":r.entity&&(yt(e,r.entity),gt("success"));break;case"call-service":if(!i.service)return void gt("failure");var n=i.service.split(".",2);e.callService(n[0],n[1],i.service_data,i.target),gt("success");break;case"fire-dom-event":ct(t,"ll-custom",i)}},wt=function(t,e,r,i){var n;"double_tap"===i&&r.double_tap_action?n=r.double_tap_action:"hold"===i&&r.hold_action?n=r.hold_action:"tap"===i&&r.tap_action&&(n=r.tap_action),bt(t,e,r,n)},$t=function(t,e,r,i,n){var a;if(n&&r.double_tap_action?a=r.double_tap_action:i&&r.hold_action?a=r.hold_action:!i&&r.tap_action&&(a=r.tap_action),a||(a={action:"more-info"}),!a.confirmation||a.confirmation.exemptions&&a.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(a.confirmation.text||"Are you sure you want to "+a.action+"?"))switch(a.action){case"more-info":(a.entity||r.entity||r.camera_image)&&(ct(t,"hass-more-info",{entityId:a.entity?a.entity:r.entity?r.entity:r.camera_image}),a.haptic&>(a.haptic));break;case"navigate":a.navigation_path&&(_t(0,a.navigation_path),a.haptic&>(a.haptic));break;case"url":a.url_path&&window.open(a.url_path),a.haptic&>(a.haptic);break;case"toggle":r.entity&&(yt(e,r.entity),a.haptic&>(a.haptic));break;case"call-service":if(!a.service)return;var o=a.service.split(".",2),s=o[0],c=o[1],l=F({},a.service_data);"entity"===l.entity_id&&(l.entity_id=r.entity),e.callService(s,c,l,a.target),a.haptic&>(a.haptic);break;case"fire-dom-event":ct(t,"ll-custom",a),a.haptic&>(a.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function St(t,e,r){if(e.has("config")||r)return!0;if(t.config.entity){var i=e.get("hass");return!i||i.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function Et(t){return void 0!==t&&"none"!==t.action}var xt=function(t,e,r){void 0===r&&(r=!0);var i={};e.forEach((function(e){if(it.includes(t.states[e].state)===r){var n=j(e),a=["cover","lock"].includes(n)?n:"homeassistant";a in i||(i[a]=[]),i[a].push(e)}})),Object.keys(i).forEach((function(e){var n;switch(e){case"lock":n=r?"unlock":"lock";break;case"cover":n=r?"open_cover":"close_cover";break;default:n=r?"turn_on":"turn_off"}t.callService(e,n,{entity_id:i[e]})}))},Ct=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},kt={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},Tt={binary_sensor:function(t,e){var r="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return r?"mdi:battery":"mdi:battery-outline";case"battery_charging":return r?"mdi:battery":"mdi:battery-charging";case"cold":return r?"mdi:thermometer":"mdi:snowflake";case"connectivity":return r?"mdi:server-network-off":"mdi:server-network";case"door":return r?"mdi:door-closed":"mdi:door-open";case"garage_door":return r?"mdi:garage":"mdi:garage-open";case"power":case"plug":return r?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return r?"mdi:check-circle":"mdi:alert-circle";case"smoke":return r?"mdi:check-circle":"mdi:smoke";case"heat":return r?"mdi:thermometer":"mdi:fire";case"light":return r?"mdi:brightness-5":"mdi:brightness-7";case"lock":return r?"mdi:lock":"mdi:lock-open";case"moisture":return r?"mdi:water-off":"mdi:water";case"motion":return r?"mdi:walk":"mdi:run";case"occupancy":case"presence":return r?"mdi:home-outline":"mdi:home";case"opening":return r?"mdi:square":"mdi:square-outline";case"running":return r?"mdi:stop":"mdi:play";case"sound":return r?"mdi:music-note-off":"mdi:music-note";case"update":return r?"mdi:package":"mdi:package-up";case"vibration":return r?"mdi:crop-portrait":"mdi:vibrate";case"window":return r?"mdi:window-closed":"mdi:window-open";default:return r?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in kt)return kt[e];if("battery"===e){var r=Number(t.state);if(isNaN(r))return"mdi:battery-unknown";var i=10*Math.round(r/10);return i>=100?"mdi:battery":i<=0?"mdi:battery-alert":"hass:battery-"+i}var n=t.attributes.unit_of_measurement;return"°C"===n||"°F"===n?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Dt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=j(t.entity_id);return e in Tt?Tt[e](t):pt(e,t.state)}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseCard=void 0,e.BaseCard=class{constructor(t,e){this.sensor_entity_id=t,this.hass=e,this.sensor=this.getSensor()}getSensor(){const t=this.hass.states[this.sensor_entity_id];return{last_update:new Date(t.attributes.last_update),data:t.attributes.data}}}},521:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(243);class a extends n.BaseCard{constructor(t,e){super(t,e)}renderStandingRow(t){return i.html` +(()=>{"use strict";var t={197:(t,e,r)=>{r.r(e),r.d(e,{DEFAULT_DOMAIN_ICON:()=>J,DEFAULT_PANEL:()=>Z,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>rt,DOMAINS_TOGGLE:()=>nt,DOMAINS_WITH_CARD:()=>X,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>i,STATES_OFF:()=>it,TimeFormat:()=>n,UNIT_C:()=>at,UNIT_F:()=>ot,applyThemesOnElement:()=>U,computeCardSize:()=>L,computeDomain:()=>j,computeEntity:()=>H,computeRTL:()=>B,computeRTLDirection:()=>W,computeStateDisplay:()=>Q,computeStateDomain:()=>q,createThing:()=>dt,debounce:()=>ht,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>ct,fixedIcons:()=>mt,formatDate:()=>u,formatDateMonth:()=>_,formatDateMonthYear:()=>g,formatDateNumeric:()=>h,formatDateShort:()=>p,formatDateTime:()=>A,formatDateTimeNumeric:()=>C,formatDateTimeWithSeconds:()=>E,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>Y,formatTime:()=>T,formatTimeWeekday:()=>P,formatTimeWithSeconds:()=>N,forwardHaptic:()=>gt,getLovelace:()=>Ct,handleAction:()=>wt,handleActionConfig:()=>bt,handleClick:()=>$t,hasAction:()=>At,hasConfigOrEntityChanged:()=>St,hasDoubleClick:()=>Et,isNumericState:()=>z,navigate:()=>vt,numberFormatToLocale:()=>V,relativeTime:()=>R,round:()=>K,stateIcon:()=>Dt,timerTimeRemaining:()=>I,toggleEntity:()=>yt,turnOnOffEntities:()=>xt,turnOnOffEntity:()=>_t});var i,n,a,o=function(){return o=Object.assign||function(t){for(var e,r=1,i=arguments.length;r0)return{value:Math.round(h),unit:"year"};var m=12*h+u.getMonth()-d.getMonth();if(Math.round(Math.abs(m))>0)return{value:Math.round(m),unit:"month"};var p=n/604800;return{value:Math.round(p),unit:"week"}}(t,r);return i?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(n.value,n.unit):Intl.NumberFormat(e.language,{style:"unit",unit:n.unit,unitDisplay:"long"}).format(Math.abs(n.value))};function I(t){var e,r=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var i=(new Date).getTime(),n=new Date(t.last_changed).getTime();r=Math.max(r-(i-n)/1e3,0)}return r}function F(){return(F=Object.assign||function(t){for(var e=1;e-1?t.split(".")[1].length:0;r.minimumFractionDigits=i,r.maximumFractionDigits=i}return r},Q=function(t,e,r,i){var n=void 0!==i?i:e.state;if("unknown"===n||"unavailable"===n)return t("state.default."+n);if(z(e)){if("monetary"===e.attributes.device_class)try{return Y(n,r,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return Y(n,r)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var a=q(e);if("input_datetime"===a){var o;if(void 0===i)return e.attributes.has_date&&e.attributes.has_time?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(o,r)):e.attributes.has_date?(o=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),u(o,r)):e.attributes.has_time?((o=new Date).setHours(e.attributes.hour,e.attributes.minute),T(o,r)):e.state;try{var s=i.split(" ");if(2===s.length)return A(new Date(s.join("T")),r);if(1===s.length){if(i.includes("-"))return u(new Date(i+"T00:00"),r);if(i.includes(":")){var c=new Date;return T(new Date(c.toISOString().split("T")[0]+"T"+i),r)}}return i}catch(t){return i}}return"humidifier"===a&&"on"===n&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===a||"number"===a||"input_number"===a?Y(n,r):e.attributes.device_class&&t("component."+a+".state."+e.attributes.device_class+"."+n)||t("component."+a+".state._."+n)||n},J="mdi:bookmark",Z="lovelace",X=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],rt=["camera","configurator","history_graph","scene"],it=["closed","locked","off"],nt=new Set(["fan","input_boolean","light","switch","group","automation"]),at="°C",ot="°F",st="group.default_view",ct=function(t,e,r,i){i=i||{},r=null==r?{}:r;var n=new Event(e,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return n.detail=r,t.dispatchEvent(n),n},lt=new Set(["call-service","divider","section","weblink","cast","select"]),ut={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},dt=function(t,e){void 0===e&&(e=!1);var r=function(t,e){return i("hui-error-card",{type:"error",error:t,config:e})},i=function(t,e){var i=window.document.createElement(t);try{if(!i.setConfig)return;i.setConfig(e)}catch(i){return console.error(t,i),r(i.message,e)}return i};if(!t||"object"!=typeof t||!e&&!t.type)return r("No type defined",t);var n=t.type;if(n&&n.startsWith("custom:"))n=n.substr("custom:".length);else if(e)if(lt.has(n))n="hui-"+n+"-row";else{if(!t.entity)return r("Invalid config given.",t);var a=t.entity.split(".",1)[0];n="hui-"+(ut[a]||"text")+"-entity-row"}else n="hui-"+n+"-card";if(customElements.get(n))return i(n,t);var o=r("Custom element doesn't exist: "+t.type+".",t);o.style.display="None";var s=setTimeout((function(){o.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),ct(o,"ll-rebuild",{},o)})),o},ht=function(t,e,r){var i;return void 0===r&&(r=!1),function(){var n=[].slice.call(arguments),a=this,o=function(){i=null,r||t.apply(a,n)},s=r&&!i;clearTimeout(i),i=setTimeout(o,e),s&&t.apply(a,n)}},mt={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in mt)return mt[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var r=e.value||e,i=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return i===r;case"<=":return i<=r;case"<":return i=":return i>=r;case">":return i>r;case"!=":return i!==r;case"regex":return i.match(r);default:return!1}},gt=function(t){ct(window,"haptic",t)},vt=function(t,e,r){void 0===r&&(r=!1),r?history.replaceState(null,"",e):history.pushState(null,"",e),ct(window,"location-changed",{replace:r})},_t=function(t,e,r){void 0===r&&(r=!0);var i,n=j(e),a="group"===n?"homeassistant":n;switch(n){case"lock":i=r?"unlock":"lock";break;case"cover":i=r?"open_cover":"close_cover";break;default:i=r?"turn_on":"turn_off"}return t.callService(a,i,{entity_id:e})},yt=function(t,e){var r=it.includes(t.states[e].state);return _t(t,e,r)},bt=function(t,e,r,i){if(i||(i={action:"more-info"}),!i.confirmation||i.confirmation.exemptions&&i.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(i.confirmation.text||"Are you sure you want to "+i.action+"?")))switch(i.action){case"more-info":(r.entity||r.camera_image)&&ct(t,"hass-more-info",{entityId:r.entity?r.entity:r.camera_image});break;case"navigate":i.navigation_path&&vt(0,i.navigation_path);break;case"url":i.url_path&&window.open(i.url_path);break;case"toggle":r.entity&&(yt(e,r.entity),gt("success"));break;case"call-service":if(!i.service)return void gt("failure");var n=i.service.split(".",2);e.callService(n[0],n[1],i.service_data,i.target),gt("success");break;case"fire-dom-event":ct(t,"ll-custom",i)}},wt=function(t,e,r,i){var n;"double_tap"===i&&r.double_tap_action?n=r.double_tap_action:"hold"===i&&r.hold_action?n=r.hold_action:"tap"===i&&r.tap_action&&(n=r.tap_action),bt(t,e,r,n)},$t=function(t,e,r,i,n){var a;if(n&&r.double_tap_action?a=r.double_tap_action:i&&r.hold_action?a=r.hold_action:!i&&r.tap_action&&(a=r.tap_action),a||(a={action:"more-info"}),!a.confirmation||a.confirmation.exemptions&&a.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(a.confirmation.text||"Are you sure you want to "+a.action+"?"))switch(a.action){case"more-info":(a.entity||r.entity||r.camera_image)&&(ct(t,"hass-more-info",{entityId:a.entity?a.entity:r.entity?r.entity:r.camera_image}),a.haptic&>(a.haptic));break;case"navigate":a.navigation_path&&(vt(0,a.navigation_path),a.haptic&>(a.haptic));break;case"url":a.url_path&&window.open(a.url_path),a.haptic&>(a.haptic);break;case"toggle":r.entity&&(yt(e,r.entity),a.haptic&>(a.haptic));break;case"call-service":if(!a.service)return;var o=a.service.split(".",2),s=o[0],c=o[1],l=F({},a.service_data);"entity"===l.entity_id&&(l.entity_id=r.entity),e.callService(s,c,l,a.target),a.haptic&>(a.haptic);break;case"fire-dom-event":ct(t,"ll-custom",a),a.haptic&>(a.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function St(t,e,r){if(e.has("config")||r)return!0;if(t.config.entity){var i=e.get("hass");return!i||i.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function Et(t){return void 0!==t&&"none"!==t.action}var xt=function(t,e,r){void 0===r&&(r=!0);var i={};e.forEach((function(e){if(it.includes(t.states[e].state)===r){var n=j(e),a=["cover","lock"].includes(n)?n:"homeassistant";a in i||(i[a]=[]),i[a].push(e)}})),Object.keys(i).forEach((function(e){var n;switch(e){case"lock":n=r?"unlock":"lock";break;case"cover":n=r?"open_cover":"close_cover";break;default:n=r?"turn_on":"turn_off"}t.callService(e,n,{entity_id:i[e]})}))},Ct=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},kt={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},Tt={binary_sensor:function(t,e){var r="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return r?"mdi:battery":"mdi:battery-outline";case"battery_charging":return r?"mdi:battery":"mdi:battery-charging";case"cold":return r?"mdi:thermometer":"mdi:snowflake";case"connectivity":return r?"mdi:server-network-off":"mdi:server-network";case"door":return r?"mdi:door-closed":"mdi:door-open";case"garage_door":return r?"mdi:garage":"mdi:garage-open";case"power":case"plug":return r?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return r?"mdi:check-circle":"mdi:alert-circle";case"smoke":return r?"mdi:check-circle":"mdi:smoke";case"heat":return r?"mdi:thermometer":"mdi:fire";case"light":return r?"mdi:brightness-5":"mdi:brightness-7";case"lock":return r?"mdi:lock":"mdi:lock-open";case"moisture":return r?"mdi:water-off":"mdi:water";case"motion":return r?"mdi:walk":"mdi:run";case"occupancy":case"presence":return r?"mdi:home-outline":"mdi:home";case"opening":return r?"mdi:square":"mdi:square-outline";case"running":return r?"mdi:stop":"mdi:play";case"sound":return r?"mdi:music-note-off":"mdi:music-note";case"update":return r?"mdi:package":"mdi:package-up";case"vibration":return r?"mdi:crop-portrait":"mdi:vibrate";case"window":return r?"mdi:window-closed":"mdi:window-open";default:return r?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in kt)return kt[e];if("battery"===e){var r=Number(t.state);if(isNaN(r))return"mdi:battery-unknown";var i=10*Math.round(r/10);return i>=100?"mdi:battery":i<=0?"mdi:battery-alert":"hass:battery-"+i}var n=t.attributes.unit_of_measurement;return"°C"===n||"°F"===n?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Dt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=j(t.entity_id);return e in Tt?Tt[e](t):pt(e,t.state)}},243:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BaseCard=void 0,e.BaseCard=class{constructor(t,e,r){this.sensor_entity_id=t,this.hass=e,this.config=r,this.sensor=this.getSensor()}getSensor(){const t=this.hass.states[this.sensor_entity_id];return{last_update:new Date(t.attributes.last_update),data:t.attributes.data}}}},521:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(243);class a extends n.BaseCard{constructor(t,e,r){super(t,e,r)}renderStandingRow(t){return i.html` ${t.position} ${t.Constructor.name} @@ -19,11 +19,11 @@ ${t.map((t=>this.renderStandingRow(t)))} - `}}e.default=a},412:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(243);class a extends n.BaseCard{constructor(t,e){super(t,e)}renderStandingRow(t){return i.html` + `}}e.default=a},412:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(593),a=r(243);class o extends a.BaseCard{constructor(t,e,r){super(t,e,r)}renderStandingRow(t){return i.html` ${t.position} ${t.Driver.code} - ${t.Driver.givenName} ${t.Driver.familyName} + ${(0,n.getDriverName)(t.Driver,this.config)} ${t.points} ${t.wins} `}render(){const t=this.sensor.data;if(!this.sensor_entity_id.endsWith("_drivers")||void 0===t)throw new Error("Please pass the correct sensor (drivers)");return i.html` @@ -40,14 +40,14 @@ ${t.map((t=>this.renderStandingRow(t)))} - `}}e.default=a},958:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(593),a=r(243);class o extends a.BaseCard{constructor(t,e,r){super(t,e),this.image_clickable=r.image_clickable}renderResultRow(t){return i.html` + `}}e.default=o},958:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(593),a=r(243);class o extends a.BaseCard{constructor(t,e,r){super(t,e,r)}renderResultRow(t){return i.html` ${t.position} - ${t.Driver.givenName} ${t.Driver.familyName} + ${(0,n.getDriverName)(t.Driver,this.config)} ${t.grid} ${t.points} ${t.status} - `}renderHeader(){const t=this.sensor.data,e=t.Circuit.Location.country.replace(" ","-"),r=i.html``,a=this.image_clickable?i.html`${r}`:r;return i.html`

  ${t.round} : ${t.raceName}

${a}
`}render(){const t=this.sensor.data;if(!this.sensor_entity_id.endsWith("_last_result")||void 0===t)throw new Error("Please pass the correct sensor (last_result)");return i.html` + `}renderHeader(){const t=this.sensor.data,e=t.Circuit.Location.country.replace(" ","-"),r=i.html``,a=this.config.image_clickable?i.html`${r}`:r;return i.html`

  ${t.round} : ${t.raceName}

${a}
`}render(){const t=this.sensor.data;if(!this.sensor_entity_id.endsWith("_last_result")||void 0===t)throw new Error("Please pass the correct sensor (last_result)");return i.html` @@ -68,14 +68,14 @@ ${t.Results.map((t=>this.renderResultRow(t)))}
- `}}e.default=o},249:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(247),a=r(347),o=r(593),s=r(243);class c extends s.BaseCard{constructor(t,e,r){super(t,e);const i=this.hass.states[this.sensor_entity_id];this.next_race=i.attributes.next_race,this.date_locale=r.date_locale,this.image_clickable=r.image_clickable}renderHeader(){const t=this.next_race.Circuit.Location.country.replace(" ","-"),e=i.html``,r=this.image_clickable?i.html`${e}`:e;return i.html`

  ${this.next_race.round} : ${this.next_race.raceName}

${r}
`}render(){if(!this.sensor_entity_id.endsWith("_races")||void 0===this.next_race)throw new Error("Please pass the correct sensor (races)");const t=new Date(this.next_race.date+"T"+this.next_race.time),e=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.FirstPractice.date+"T"+this.next_race.FirstPractice.time),this.hass.locale),r=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.SecondPractice.date+"T"+this.next_race.SecondPractice.time),this.hass.locale),o=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.ThirdPractice.date+"T"+this.next_race.ThirdPractice.time),this.hass.locale),s=(0,a.formatDateTimeRaceInfo)(t,this.hass.locale),c=void 0!==this.next_race.Qualifying?(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.Qualifying.date+"T"+this.next_race.Qualifying.time),this.hass.locale):"-",l=void 0!==this.next_race.Sprint?(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.Sprint.date+"T"+this.next_race.Sprint.time),this.hass.locale):"-";return i.html` + `}}e.default=o},249:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(692),n=r(247),a=r(347),o=r(593),s=r(243);class c extends s.BaseCard{constructor(t,e,r){super(t,e,r);const i=this.hass.states[this.sensor_entity_id];this.next_race=i.attributes.next_race}renderHeader(){const t=this.next_race.Circuit.Location.country.replace(" ","-"),e=i.html``,r=this.config.image_clickable?i.html`${e}`:e;return i.html`

  ${this.next_race.round} : ${this.next_race.raceName}

${r}
`}render(){if(!this.sensor_entity_id.endsWith("_races")||void 0===this.next_race)throw new Error("Please pass the correct sensor (races)");const t=new Date(this.next_race.date+"T"+this.next_race.time),e=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.FirstPractice.date+"T"+this.next_race.FirstPractice.time),this.hass.locale),r=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.SecondPractice.date+"T"+this.next_race.SecondPractice.time),this.hass.locale),o=(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.ThirdPractice.date+"T"+this.next_race.ThirdPractice.time),this.hass.locale),s=(0,a.formatDateTimeRaceInfo)(t,this.hass.locale),c=void 0!==this.next_race.Qualifying?(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.Qualifying.date+"T"+this.next_race.Qualifying.time),this.hass.locale):"-",l=void 0!==this.next_race.Sprint?(0,a.formatDateTimeRaceInfo)(new Date(this.next_race.Sprint.date+"T"+this.next_race.Sprint.time),this.hass.locale):"-";return i.html` - + @@ -83,12 +83,12 @@
${this.renderHeader()}
Date${(0,n.formatDateNumeric)(t,this.hass.locale,this.date_locale)} Practice 1${e}
Date${(0,n.formatDateNumeric)(t,this.hass.locale,this.config.date_locale)} Practice 1${e}
Race${this.next_race.round} Practice 2${r}
Race name${this.next_race.raceName} Practice 3${o}
Circuit name${this.next_race.Circuit.circuitName} Qualifying${c}
City${this.next_race.Circuit.Location.locality} Race${s}
- `}}e.default=c},269:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(197),n=r(692),a=r(247),o=r(243);class s extends o.BaseCard{constructor(t,e,r){super(t,e),this.date_locale=r.date_locale}renderScheduleRow(t){const e=new Date(t.date+"T"+t.time);return n.html` - + `}}e.default=c},269:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:!0});const i=r(197),n=r(692),a=r(247),o=r(243);class s extends o.BaseCard{constructor(t,e,r){super(t,e,r)}renderLocation(t){const e=`${t.Location.locality}, ${t.Location.country}`;return this.config.location_clickable?n.html`${e}`:e}renderScheduleRow(t){const e=new Date(t.date+"T"+t.time),r=this.config.previous_race&&e ${t.round} ${t.Circuit.circuitName} - ${t.Circuit.Location.locality}, ${t.Circuit.Location.country} - ${(0,a.formatDate)(e,this.hass.locale,this.date_locale)} + ${this.renderLocation(t.Circuit)} + ${(0,a.formatDate)(e,this.hass.locale,this.config.date_locale)} ${(0,i.formatTime)(e,this.hass.locale)} `}render(){const t=this.sensor.data;if(!this.sensor_entity_id.endsWith("_races")||void 0===t)throw new Error("Please pass the correct sensor (races)");return n.html` @@ -105,7 +105,7 @@ ${t.map((t=>this.renderScheduleRow(t)))}
- `}}e.default=s},607:function(t,e,r){var i=this&&this.__decorate||function(t,e,r,i){var n,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(o=(a<3?n(o):a>3?n(e,r,o):n(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o};Object.defineProperty(e,"__esModule",{value:!0});const n=r(147),a=r(595),o=r(98),s=r(392),c=r(593),l=r(299),u=r(521),d=r(412),h=r(269),m=r(249),p=r(958);console.info(`%c FORMULAONE-CARD %c ${n.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"formulaone-card",name:"FormulaOne card",preview:!1,description:"Present the data of hass-formulaoneapi in a pretty way"});let f=class extends s.LitElement{setConfig(t){(0,c.checkConfig)(t),this.config=Object.assign({},t)}shouldUpdate(t){return(0,c.hasConfigOrEntitiesChanged)(this.config,t)}set hass(t){this._hass=t,this.config.hass=t}static get styles(){return l.style}renderCardType(){switch(this.config.card_type){case o.FormulaOneCardType.ConstructorStandings:return new u.default(this.config.sensor,this._hass).render();case o.FormulaOneCardType.DriverStandings:return new d.default(this.config.sensor,this._hass).render();case o.FormulaOneCardType.Schedule:return new h.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.NextRace:return new m.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.LastResult:return new p.default(this.config.sensor,this._hass,this.config).render()}}render(){if(!this._hass||!this.config)return s.html``;try{return s.html` + `}}e.default=s},607:function(t,e,r){var i=this&&this.__decorate||function(t,e,r,i){var n,a=arguments.length,o=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,r,i);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(o=(a<3?n(o):a>3?n(e,r,o):n(e,r))||o);return a>3&&o&&Object.defineProperty(e,r,o),o};Object.defineProperty(e,"__esModule",{value:!0});const n=r(147),a=r(595),o=r(98),s=r(392),c=r(593),l=r(299),u=r(521),d=r(412),h=r(269),m=r(249),p=r(958);console.info(`%c FORMULAONE-CARD %c ${n.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"formulaone-card",name:"FormulaOne card",preview:!1,description:"Present the data of hass-formulaoneapi in a pretty way"});let f=class extends s.LitElement{setConfig(t){(0,c.checkConfig)(t),this.config=Object.assign({},t)}shouldUpdate(t){return(0,c.hasConfigOrEntitiesChanged)(this.config,t)}set hass(t){this._hass=t,this.config.hass=t}static get styles(){return l.style}renderCardType(){switch(this.config.card_type){case o.FormulaOneCardType.ConstructorStandings:return new u.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.DriverStandings:return new d.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.Schedule:return new h.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.NextRace:return new m.default(this.config.sensor,this._hass,this.config).render();case o.FormulaOneCardType.LastResult:return new p.default(this.config.sensor,this._hass,this.config).render()}}render(){if(!this._hass||!this.config)return s.html``;try{return s.html` ${this.config.title?s.html`

${this.config.title}

`:""} ${this.renderCardType()} @@ -142,4 +142,17 @@ .width-60 { width: 60px; } -`},98:(t,e)=>{var r;Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardType=void 0,(r=e.FormulaOneCardType||(e.FormulaOneCardType={})).DriverStandings="driver_standings",r.ConstructorStandings="constructor_standings",r.NextRace="next_race",r.Schedule="schedule",r.LastResult="last_result"},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getCountryFlagUrl=e.checkConfig=e.hasConfigOrEntitiesChanged=void 0,e.hasConfigOrEntitiesChanged=(t,e)=>{if(e.has("config"))return!0;const r=e.get("_hass");return!!r&&r.states[t.sensor]!==t.hass.states[t.sensor]},e.checkConfig=t=>{if(void 0===t.card_type)throw new Error("Please define FormulaOne card type (card_type).");if(void 0===t.sensor)throw new Error("Please define FormulaOne sensor.")},e.getCountryFlagUrl=t=>{const e=[{countryDashed:"USA",name:"United-States-of-America"}].filter((e=>e.countryDashed==t));return e.length>0&&(t=e[0].name),`https://www.countries-ofthe-world.com/flags-normal/flag-of-${t}.png`}},692:(t,e,r)=>{var i;r.r(e),r.d(e,{_$LH:()=>H,html:()=>A,noChange:()=>E,nothing:()=>x,render:()=>k,svg:()=>S});const n=window,a=n.trustedTypes,o=a?a.createPolicy("lit-html",{createHTML:t=>t}):void 0,s=`lit$${(Math.random()+"").slice(9)}$`,c="?"+s,l=`<${c}>`,u=document,d=(t="")=>u.createComment(t),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,p=t=>m(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,_=/>/g,v=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),y=/'/g,b=/"/g,w=/^(?:script|style|textarea|title)$/i,$=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),A=$(1),S=$(2),E=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),C=new WeakMap,k=(t,e,r)=>{var i,n;const a=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:e;let o=a._$litPart$;if(void 0===o){const t=null!==(n=null==r?void 0:r.renderBefore)&&void 0!==n?n:null;a._$litPart$=o=new M(e.insertBefore(d(),t),t,void 0,null!=r?r:{})}return o._$AI(t),o},T=u.createTreeWalker(u,129,null,!1),D=(t,e)=>{const r=t.length-1,i=[];let n,a=2===e?"":"",c=f;for(let e=0;e"===u[0]?(c=null!=n?n:f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,o=u[1],c=void 0===u[3]?v:'"'===u[3]?b:y):c===b||c===y?c=v:c===g||c===_?c=f:(c=v,n=void 0);const m=c===v&&t[e+1].startsWith("/>")?" ":"";a+=c===f?r+l:d>=0?(i.push(o),r.slice(0,d)+"$lit$"+r.slice(d)+s+m):r+s+(-2===d?(i.push(void 0),e):m)}const u=a+(t[r]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==o?o.createHTML(u):u,i]};class O{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let n=0,o=0;const l=t.length-1,u=this.parts,[h,m]=D(t,e);if(this.el=O.createElement(h,r),T.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=T.nextNode())&&u.length0){i.textContent=a?a.emptyScript:"";for(let r=0;r2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=x}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,r,i){const n=this.strings;let a=!1;if(void 0===n)t=N(this,t,e,0),a=!h(t)||t!==this._$AH&&t!==E,a&&(this._$AH=t);else{const i=t;let o,s;for(t=n[0],o=0;o{r.r(e),r.d(e,{customElement:()=>i,eventOptions:()=>c,property:()=>a,query:()=>l,queryAll:()=>u,queryAssignedElements:()=>p,queryAssignedNodes:()=>f,queryAsync:()=>d,state:()=>o});const i=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:r,elements:i}=e;return{kind:r,elements:i,finisher(e){customElements.define(t,e)}}})(t,e),n=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function a(t){return(e,r)=>void 0!==r?((t,e,r)=>{e.constructor.createProperty(r,t)})(t,e,r):n(t,e)}function o(t){return a({...t,state:!0})}const s=({finisher:t,descriptor:e})=>(r,i)=>{var n;if(void 0===i){const i=null!==(n=r.originalKey)&&void 0!==n?n:r.key,a=null!=e?{kind:"method",placement:"prototype",key:i,descriptor:e(r.key)}:{...r,key:i};return null!=t&&(a.finisher=function(e){t(e,i)}),a}{const n=r.constructor;void 0!==e&&Object.defineProperty(r,i,e(i)),null==t||t(n,i)}};function c(t){return s({finisher:(e,r)=>{Object.assign(e.prototype[r],t)}})}function l(t,e){return s({descriptor:r=>{const i={get(){var e,r;return null!==(r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==r?r:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof r?Symbol():"__"+r;i.get=function(){var r,i;return void 0===this[e]&&(this[e]=null!==(i=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(t))&&void 0!==i?i:null),this[e]}}return i}})}function u(t){return s({descriptor:e=>({get(){var e,r;return null!==(r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==r?r:[]},enumerable:!0,configurable:!0})})}function d(t){return s({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var h;const m=null!=(null===(h=window.HTMLSlotElement)||void 0===h?void 0:h.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function p(t){const{slot:e,selector:r}=null!=t?t:{};return s({descriptor:i=>({get(){var i;const n="slot"+(e?`[name=${e}]`:":not([name])"),a=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(n),o=null!=a?m(a,t):[];return r?o.filter((t=>t.matches(r))):o},enumerable:!0,configurable:!0})})}function f(t,e,r){let i,n=t;return"object"==typeof t?(n=t.slot,i=t):i={flatten:e},r?p({slot:n,flatten:e,selector:r}):s({descriptor:t=>({get(){var t,e;const r="slot"+(n?`[name=${n}]`:":not([name])"),a=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(r);return null!==(e=null==a?void 0:a.assignedNodes(i))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}},392:(t,e,r)=>{r.r(e),r.d(e,{CSSResult:()=>s,LitElement:()=>E,ReactiveElement:()=>b,UpdatingElement:()=>S,_$LE:()=>C,_$LH:()=>A._$LH,adoptStyles:()=>u,css:()=>l,defaultConverter:()=>_,getCompatibleStyle:()=>d,html:()=>A.html,noChange:()=>A.noChange,notEqual:()=>v,nothing:()=>A.nothing,render:()=>A.render,supportsAdoptingStyleSheets:()=>n,svg:()=>A.svg,unsafeCSS:()=>c});const i=window,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;class s{constructor(t,e,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(e,t))}return t}toString(){return this.cssText}}const c=t=>new s("string"==typeof t?t:t+"",void 0,a),l=(t,...e)=>{const r=1===t.length?t[0]:e.reduce(((e,r,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1]),t[0]);return new s(r,t,a)},u=(t,e)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const r=document.createElement("style"),n=i.litNonce;void 0!==n&&r.setAttribute("nonce",n),r.textContent=e.cssText,t.appendChild(r)}))},d=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return c(e)})(t):t;var h;const m=window,p=m.trustedTypes,f=p?p.emptyScript:"",g=m.reactiveElementPolyfillSupport,_={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},v=(t,e)=>e!==t&&(e==e||t==t),y={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:v};class b extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,r)=>{const i=this._$Ep(r,e);void 0!==i&&(this._$Ev.set(i,r),t.push(i))})),t}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const r="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,r,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||y}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of e)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Ep(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,r;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(r=t.hostConnected)||void 0===r||r.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e,r=y){var i;const n=this.constructor._$Ep(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==(null===(i=r.converter)||void 0===i?void 0:i.toAttribute)?r.converter:_).toAttribute(e,r.type);this._$El=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$El=null}}_$AK(t,e){var r;const i=this.constructor,n=i._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=i.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(r=t.converter)||void 0===r?void 0:r.fromAttribute)?t.converter:_;this._$El=n,this[n]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,r){let i=!0;void 0!==t&&(((r=r||this.constructor.getPropertyOptions(t)).hasChanged||v)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===r.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,r))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(r)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:b}),(null!==(h=m.reactiveElementVersions)&&void 0!==h?h:m.reactiveElementVersions=[]).push("1.4.1");var w,$,A=r(692);const S=b;class E extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const r=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,A.render)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return A.noChange}}E.finalized=!0,E._$litElement$=!0,null===(w=globalThis.litElementHydrateSupport)||void 0===w||w.call(globalThis,{LitElement:E});const x=globalThis.litElementPolyfillSupport;null==x||x({LitElement:E});const C={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(null!==($=globalThis.litElementVersions)&&void 0!==$?$:globalThis.litElementVersions=[]).push("3.2.2")},147:t=>{t.exports=JSON.parse('{"name":"formulaone-card","version":"0.0.3","description":"Frontend card for hass-formulaoneapi","main":"index.js","scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/formulaone-card/formulaone-card/jest.results.json"},"repository":{"type":"git","url":"git+https://github.com/marcokreeft87/formulaone-card.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/marcokreeft87/formulaone-card/issues"},"homepage":"https://github.com/marcokreeft87/formulaone-card#readme","devDependencies":{"@types/jest":"^29.1.1","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","eslint":"^8.24.0","home-assistant-js-websocket":"^8.0.0","lit":"^2.3.1","typescript":"^4.8.4","webpack":"^5.74.0","webpack-cli":"^4.10.0"},"dependencies":{"@babel/plugin-transform-runtime":"^7.19.1","@babel/preset-env":"^7.19.3","@lit-labs/scoped-registry-mixin":"^1.0.1","babel-jest":"^29.1.2","compression-webpack-plugin":"^10.0.0","custom-card-helpers":"^1.9.0","jest-environment-jsdom":"^29.1.2","jest-ts-auto-mock":"^2.1.0","ts-auto-mock":"^3.6.2","ts-jest":"^29.0.3","ts-loader":"^9.4.1","ttypescript":"^1.5.13","yarn":"^1.22.19"}}')}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,r),a.exports}r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(607)})(); \ No newline at end of file + .hide { + display: none; + } + .strikethrough { + text-decoration: line-through; + } + .italic { + font-style: italic; + } + a { + text-decoration: none; + color: var(--secondary-text-color); + } +`},98:(t,e)=>{var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.FormulaOneCardType=e.PreviousRaceDisplay=void 0,(i=e.PreviousRaceDisplay||(e.PreviousRaceDisplay={})).Strikethrough="strikethrough",i.Italic="italic",i.Hide="hide",(r=e.FormulaOneCardType||(e.FormulaOneCardType={})).DriverStandings="driver_standings",r.ConstructorStandings="constructor_standings",r.NextRace="next_race",r.Schedule="schedule",r.LastResult="last_result"},593:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getDriverName=e.getCountryFlagUrl=e.checkConfig=e.hasConfigOrEntitiesChanged=void 0,e.hasConfigOrEntitiesChanged=(t,e)=>{if(e.has("config"))return!0;const r=e.get("_hass");return!!r&&r.states[t.sensor]!==t.hass.states[t.sensor]},e.checkConfig=t=>{if(void 0===t.card_type)throw new Error("Please define FormulaOne card type (card_type).");if(void 0===t.sensor)throw new Error("Please define FormulaOne sensor.")},e.getCountryFlagUrl=t=>{const e=[{countryDashed:"USA",name:"United-States-of-America"}].filter((e=>e.countryDashed==t));return e.length>0&&(t=e[0].name),`https://www.countries-ofthe-world.com/flags-normal/flag-of-${t}.png`},e.getDriverName=(t,e)=>{const r="VER"==t.code?1:t.permanentNumber;return`${t.givenName} ${t.familyName}${e.show_carnumber?` #${r}`:""}`}},692:(t,e,r)=>{var i;r.r(e),r.d(e,{_$LH:()=>H,html:()=>A,noChange:()=>E,nothing:()=>x,render:()=>k,svg:()=>S});const n=window,a=n.trustedTypes,o=a?a.createPolicy("lit-html",{createHTML:t=>t}):void 0,s=`lit$${(Math.random()+"").slice(9)}$`,c="?"+s,l=`<${c}>`,u=document,d=(t="")=>u.createComment(t),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,m=Array.isArray,p=t=>m(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,g=/-->/g,v=/>/g,_=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),y=/'/g,b=/"/g,w=/^(?:script|style|textarea|title)$/i,$=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),A=$(1),S=$(2),E=Symbol.for("lit-noChange"),x=Symbol.for("lit-nothing"),C=new WeakMap,k=(t,e,r)=>{var i,n;const a=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:e;let o=a._$litPart$;if(void 0===o){const t=null!==(n=null==r?void 0:r.renderBefore)&&void 0!==n?n:null;a._$litPart$=o=new M(e.insertBefore(d(),t),t,void 0,null!=r?r:{})}return o._$AI(t),o},T=u.createTreeWalker(u,129,null,!1),D=(t,e)=>{const r=t.length-1,i=[];let n,a=2===e?"":"",c=f;for(let e=0;e"===u[0]?(c=null!=n?n:f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,o=u[1],c=void 0===u[3]?_:'"'===u[3]?b:y):c===b||c===y?c=_:c===g||c===v?c=f:(c=_,n=void 0);const m=c===_&&t[e+1].startsWith("/>")?" ":"";a+=c===f?r+l:d>=0?(i.push(o),r.slice(0,d)+"$lit$"+r.slice(d)+s+m):r+s+(-2===d?(i.push(void 0),e):m)}const u=a+(t[r]||"")+(2===e?"":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==o?o.createHTML(u):u,i]};class N{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let n=0,o=0;const l=t.length-1,u=this.parts,[h,m]=D(t,e);if(this.el=N.createElement(h,r),T.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(i=T.nextNode())&&u.length0){i.textContent=a?a.emptyScript:"";for(let r=0;r2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=x}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,r,i){const n=this.strings;let a=!1;if(void 0===n)t=O(this,t,e,0),a=!h(t)||t!==this._$AH&&t!==E,a&&(this._$AH=t);else{const i=t;let o,s;for(t=n[0],o=0;o{r.r(e),r.d(e,{customElement:()=>i,eventOptions:()=>c,property:()=>a,query:()=>l,queryAll:()=>u,queryAssignedElements:()=>p,queryAssignedNodes:()=>f,queryAsync:()=>d,state:()=>o});const i=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{const{kind:r,elements:i}=e;return{kind:r,elements:i,finisher(e){customElements.define(t,e)}}})(t,e),n=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}};function a(t){return(e,r)=>void 0!==r?((t,e,r)=>{e.constructor.createProperty(r,t)})(t,e,r):n(t,e)}function o(t){return a({...t,state:!0})}const s=({finisher:t,descriptor:e})=>(r,i)=>{var n;if(void 0===i){const i=null!==(n=r.originalKey)&&void 0!==n?n:r.key,a=null!=e?{kind:"method",placement:"prototype",key:i,descriptor:e(r.key)}:{...r,key:i};return null!=t&&(a.finisher=function(e){t(e,i)}),a}{const n=r.constructor;void 0!==e&&Object.defineProperty(r,i,e(i)),null==t||t(n,i)}};function c(t){return s({finisher:(e,r)=>{Object.assign(e.prototype[r],t)}})}function l(t,e){return s({descriptor:r=>{const i={get(){var e,r;return null!==(r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t))&&void 0!==r?r:null},enumerable:!0,configurable:!0};if(e){const e="symbol"==typeof r?Symbol():"__"+r;i.get=function(){var r,i;return void 0===this[e]&&(this[e]=null!==(i=null===(r=this.renderRoot)||void 0===r?void 0:r.querySelector(t))&&void 0!==i?i:null),this[e]}}return i}})}function u(t){return s({descriptor:e=>({get(){var e,r;return null!==(r=null===(e=this.renderRoot)||void 0===e?void 0:e.querySelectorAll(t))&&void 0!==r?r:[]},enumerable:!0,configurable:!0})})}function d(t){return s({descriptor:e=>({async get(){var e;return await this.updateComplete,null===(e=this.renderRoot)||void 0===e?void 0:e.querySelector(t)},enumerable:!0,configurable:!0})})}var h;const m=null!=(null===(h=window.HTMLSlotElement)||void 0===h?void 0:h.prototype.assignedElements)?(t,e)=>t.assignedElements(e):(t,e)=>t.assignedNodes(e).filter((t=>t.nodeType===Node.ELEMENT_NODE));function p(t){const{slot:e,selector:r}=null!=t?t:{};return s({descriptor:i=>({get(){var i;const n="slot"+(e?`[name=${e}]`:":not([name])"),a=null===(i=this.renderRoot)||void 0===i?void 0:i.querySelector(n),o=null!=a?m(a,t):[];return r?o.filter((t=>t.matches(r))):o},enumerable:!0,configurable:!0})})}function f(t,e,r){let i,n=t;return"object"==typeof t?(n=t.slot,i=t):i={flatten:e},r?p({slot:n,flatten:e,selector:r}):s({descriptor:t=>({get(){var t,e;const r="slot"+(n?`[name=${n}]`:":not([name])"),a=null===(t=this.renderRoot)||void 0===t?void 0:t.querySelector(r);return null!==(e=null==a?void 0:a.assignedNodes(i))&&void 0!==e?e:[]},enumerable:!0,configurable:!0})})}},392:(t,e,r)=>{r.r(e),r.d(e,{CSSResult:()=>s,LitElement:()=>E,ReactiveElement:()=>b,UpdatingElement:()=>S,_$LE:()=>C,_$LH:()=>A._$LH,adoptStyles:()=>u,css:()=>l,defaultConverter:()=>v,getCompatibleStyle:()=>d,html:()=>A.html,noChange:()=>A.noChange,notEqual:()=>_,nothing:()=>A.nothing,render:()=>A.render,supportsAdoptingStyleSheets:()=>n,svg:()=>A.svg,unsafeCSS:()=>c});const i=window,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),o=new WeakMap;class s{constructor(t,e,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(e,t))}return t}toString(){return this.cssText}}const c=t=>new s("string"==typeof t?t:t+"",void 0,a),l=(t,...e)=>{const r=1===t.length?t[0]:e.reduce(((e,r,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+t[i+1]),t[0]);return new s(r,t,a)},u=(t,e)=>{n?t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):e.forEach((e=>{const r=document.createElement("style"),n=i.litNonce;void 0!==n&&r.setAttribute("nonce",n),r.textContent=e.cssText,t.appendChild(r)}))},d=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return c(e)})(t):t;var h;const m=window,p=m.trustedTypes,f=p?p.emptyScript:"",g=m.reactiveElementPolyfillSupport,v={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},_=(t,e)=>e!==t&&(e==e||t==t),y={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:_};class b extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;null!==(e=this.h)&&void 0!==e||(this.h=[]),this.h.push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,r)=>{const i=this._$Ep(r,e);void 0!==i&&(this._$Ev.set(i,r),t.push(i))})),t}static createProperty(t,e=y){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const r="symbol"==typeof t?Symbol():"__"+t,i=this.getPropertyDescriptor(t,r,e);void 0!==i&&Object.defineProperty(this.prototype,t,i)}}static getPropertyDescriptor(t,e,r){return{get(){return this[e]},set(i){const n=this[t];this[e]=i,this.requestUpdate(t,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||y}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of e)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Ep(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,r;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(r=t.hostConnected)||void 0===r||r.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const e=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return u(e,this.constructor.elementStyles),e}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$EO(t,e,r=y){var i;const n=this.constructor._$Ep(t,r);if(void 0!==n&&!0===r.reflect){const a=(void 0!==(null===(i=r.converter)||void 0===i?void 0:i.toAttribute)?r.converter:v).toAttribute(e,r.type);this._$El=t,null==a?this.removeAttribute(n):this.setAttribute(n,a),this._$El=null}}_$AK(t,e){var r;const i=this.constructor,n=i._$Ev.get(t);if(void 0!==n&&this._$El!==n){const t=i.getPropertyOptions(n),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(r=t.converter)||void 0===r?void 0:r.fromAttribute)?t.converter:v;this._$El=n,this[n]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,r){let i=!0;void 0!==t&&(((r=r||this.constructor.getPropertyOptions(t)).hasChanged||_)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===r.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,r))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(r)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(r)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}b.finalized=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:b}),(null!==(h=m.reactiveElementVersions)&&void 0!==h?h:m.reactiveElementVersions=[]).push("1.4.1");var w,$,A=r(692);const S=b;class E extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const r=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=r.firstChild),r}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=(0,A.render)(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return A.noChange}}E.finalized=!0,E._$litElement$=!0,null===(w=globalThis.litElementHydrateSupport)||void 0===w||w.call(globalThis,{LitElement:E});const x=globalThis.litElementPolyfillSupport;null==x||x({LitElement:E});const C={_$AK:(t,e,r)=>{t._$AK(e,r)},_$AL:t=>t._$AL};(null!==($=globalThis.litElementVersions)&&void 0!==$?$:globalThis.litElementVersions=[]).push("3.2.2")},147:t=>{t.exports=JSON.parse('{"name":"formulaone-card","version":"0.0.3","description":"Frontend card for hass-formulaoneapi","main":"index.js","scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/formulaone-card/formulaone-card/jest.results.json"},"repository":{"type":"git","url":"git+https://github.com/marcokreeft87/formulaone-card.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/marcokreeft87/formulaone-card/issues"},"homepage":"https://github.com/marcokreeft87/formulaone-card#readme","devDependencies":{"@types/jest":"^29.1.1","@typescript-eslint/eslint-plugin":"^5.39.0","@typescript-eslint/parser":"^5.39.0","eslint":"^8.24.0","home-assistant-js-websocket":"^8.0.0","lit":"^2.3.1","typescript":"^4.8.4","webpack":"^5.74.0","webpack-cli":"^4.10.0"},"dependencies":{"@babel/plugin-transform-runtime":"^7.19.1","@babel/preset-env":"^7.19.3","@lit-labs/scoped-registry-mixin":"^1.0.1","babel-jest":"^29.1.2","compression-webpack-plugin":"^10.0.0","custom-card-helpers":"^1.9.0","jest-environment-jsdom":"^29.1.2","jest-ts-auto-mock":"^2.1.0","ts-auto-mock":"^3.6.2","ts-jest":"^29.0.3","ts-loader":"^9.4.1","ttypescript":"^1.5.13","yarn":"^1.22.19"}}')}},e={};function r(i){var n=e[i];if(void 0!==n)return n.exports;var a=e[i]={exports:{}};return t[i].call(a.exports,a,a.exports,r),a.exports}r.d=(t,e)=>{for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(607)})(); \ No newline at end of file diff --git a/formulaone-card.js.gz b/formulaone-card.js.gz index 1aa8a8dde944c1f15a5b7da68a5911b75e4c6d08..a427b6453ffd2561014033e1b62b88a14f5a83e1 100644 GIT binary patch literal 17355 zcmV(;K-<3`iwFP!000023hjOCdfP^l=>K^N3ae3os0oSkB{67-qe$}DJGSh#I)hmD9LfMv*&y#Up|ZIYjt&X-MYGa~?Se)y}84N5j4M?{?lC z4Bza&KM1g)e`h-9!_L9}TT1&cllJ4A{hx;W2S;y?{yu!ON126SvW>&x>oYQERG#8Y#ib;i4dxsKarT4ic(Osx@&c~F0 zNcnr&{M2q{U$D4PNG9r|)L&T|UB>77^HQ+XT98NC+iVmiGVe#0!>B}jSw=i=qRtIJq_E;Q7`S~3A zMByhqJr|RH{xa_8>+7B_m;%S|@T%N#e&VV2XL%+vaWmsSVEz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@ld%^CotWK99-anT{+JxtmPyikb&3DkGr<)!qZv zhr;4w{vzAn%NE#n?Fb1N91kn`vaj|cU(sF9t8SfEb6#yUm*swah3?A(af9?U+1(bHkS9ELH(AS{Grk`im^0# zC;VRvNRf>cPH^WWaVj8_7x)7oRNVOX+l_C1QBZGJkaf+^W@F>Z`!1t+P2S zcqn!OngV708{wV#*vQ&i=aD*i9|TnS760Ik+AvVOBv__&x?PjPoa-#VJWsOg#Z375 zYmue!C!34eT)d7G9&SvsDc{KFc!j|R*4=2Jb>SOZ^>g*~DmDm`1%nar0_H5gMI2FN zXyDLItj;`7HU3BIPSRe zbc7CR0PN3*nu2f$P5*uCrQZY5$W%H}Syz(QhWyi=CG!g+$G<=KpS|=q+Y8g$$ZMr! z4krEJZ+%BeI4XS5G{#+C0n|Wmo@S#|aze75cWGcJ- zUbe5&x}zkPMSIv_iI`}h;Ve4i$%Y(T*F2iq1v;cl!=du`e($A3jVg=paKL!eE0c>0 z{LgspSQ4ET8wFl%Fz)930*060cBk=;#9I%Bg$+?V-5Tn*Xf;i-ZDbr>J%9@7I071* zjJ)rvi~bXkI)!XpVjG)9;9_7g$ln0D<7`^%h>D1!3j~~Xr1eQl|ut}z82d|BmXx1GY++!veQV}OO%|9^t8u~5m_001sG BNnQW| diff --git a/package.json b/package.json index d9eeb22..f9cea37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "formulaone-card", - "version": "0.0.3", + "version": "0.1.0", "description": "Frontend card for hass-formulaoneapi", "main": "index.js", "scripts": { diff --git a/src/cards/base-card.ts b/src/cards/base-card.ts index 23d02eb..876d71b 100644 --- a/src/cards/base-card.ts +++ b/src/cards/base-card.ts @@ -9,9 +9,10 @@ export abstract class BaseCard { hass: HomeAssistant; config: FormulaOneCardConfig; - constructor(sensor: string, hass: HomeAssistant) { + constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { this.sensor_entity_id = sensor; this.hass = hass; + this.config = config; this.sensor = this.getSensor(); } diff --git a/src/cards/constructor-standings.ts b/src/cards/constructor-standings.ts index 38559a9..33de916 100644 --- a/src/cards/constructor-standings.ts +++ b/src/cards/constructor-standings.ts @@ -1,12 +1,12 @@ import { HomeAssistant } from "custom-card-helpers"; import { html, HTMLTemplateResult } from "lit-html"; -import { ConstructorStanding } from "../types/formulaone-card-types"; +import { ConstructorStanding, FormulaOneCardConfig } from "../types/formulaone-card-types"; import { BaseCard } from "./base-card"; export default class ConstructorStandings extends BaseCard { - constructor(sensor: string, hass: HomeAssistant) { - super(sensor, hass); + constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { + super(sensor, hass, config); } renderStandingRow(standing: ConstructorStanding): HTMLTemplateResult { diff --git a/src/cards/driver-standings.ts b/src/cards/driver-standings.ts index 236ff27..3450701 100644 --- a/src/cards/driver-standings.ts +++ b/src/cards/driver-standings.ts @@ -1,12 +1,13 @@ import { HomeAssistant } from "custom-card-helpers"; import { html, HTMLTemplateResult } from "lit-html"; -import { DriverStanding } from "../types/formulaone-card-types"; +import { DriverStanding, FormulaOneCardConfig } from "../types/formulaone-card-types"; +import { getDriverName } from "../utils"; import { BaseCard } from "./base-card"; export default class DriverStandings extends BaseCard { - constructor(sensor: string, hass: HomeAssistant) { - super(sensor, hass); + constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { + super(sensor, hass, config); } renderStandingRow(standing: DriverStanding): HTMLTemplateResult { @@ -14,7 +15,7 @@ export default class DriverStandings extends BaseCard { ${standing.position} ${standing.Driver.code} - ${standing.Driver.givenName} ${standing.Driver.familyName} + ${getDriverName(standing.Driver, this.config)} ${standing.points} ${standing.wins} `; diff --git a/src/cards/last-result.ts b/src/cards/last-result.ts index b3787b5..df10979 100644 --- a/src/cards/last-result.ts +++ b/src/cards/last-result.ts @@ -1,18 +1,13 @@ import { HomeAssistant } from "custom-card-helpers"; import { html, HTMLTemplateResult } from "lit-html"; import { FormulaOneCardConfig, Race, Result } from "../types/formulaone-card-types"; -import { getCountryFlagUrl } from "../utils"; +import { getCountryFlagUrl, getDriverName } from "../utils"; import { BaseCard } from "./base-card"; export default class LastResult extends BaseCard { - date_locale?: string; - image_clickable?: boolean; - constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { - super(sensor, hass); - - this.image_clickable = config.image_clickable; + super(sensor, hass, config); } renderResultRow(result: Result): HTMLTemplateResult { @@ -20,7 +15,7 @@ export default class LastResult extends BaseCard { return html` ${result.position} - ${result.Driver.givenName} ${result.Driver.familyName} + ${getDriverName(result.Driver, this.config)} ${result.grid} ${result.points} ${result.status} @@ -32,7 +27,7 @@ export default class LastResult extends BaseCard { const data = this.sensor.data as Race; const countryDashed = data.Circuit.Location.country.replace(" ","-"); const imageHtml = html``; - const imageWithLinkHtml = this.image_clickable ? html`${imageHtml}` : imageHtml; + const imageWithLinkHtml = this.config.image_clickable ? html`${imageHtml}` : imageHtml; return html`

  ${data.round} : ${data.raceName}

${imageWithLinkHtml}
` } diff --git a/src/cards/next-race.ts b/src/cards/next-race.ts index 5b6e270..f6bfda1 100644 --- a/src/cards/next-race.ts +++ b/src/cards/next-race.ts @@ -9,24 +9,20 @@ import { BaseCard } from "./base-card"; export default class NextRace extends BaseCard { next_race: Race; - date_locale?: string; - image_clickable?: boolean; constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { - super(sensor, hass); + super(sensor, hass, config); const sensorEntity = this.hass.states[this.sensor_entity_id]; this.next_race = sensorEntity.attributes['next_race'] as Race; - this.date_locale = config.date_locale; - this.image_clickable = config.image_clickable; } renderHeader(): HTMLTemplateResult { const countryDashed = this.next_race.Circuit.Location.country.replace(" ","-"); const imageHtml = html``; - const imageWithLinkHtml = this.image_clickable ? html`${imageHtml}` : imageHtml; + const imageWithLinkHtml = this.config.image_clickable ? html`${imageHtml}` : imageHtml; return html`

  ${this.next_race.round} : ${this.next_race.raceName}

${imageWithLinkHtml}
` } @@ -52,7 +48,7 @@ export default class NextRace extends BaseCard { ${this.renderHeader()} - Date${formatDateNumeric(raceDate, this.hass.locale, this.date_locale)} Practice 1${freePractice1} + Date${formatDateNumeric(raceDate, this.hass.locale, this.config.date_locale)} Practice 1${freePractice1} Race${this.next_race.round} Practice 2${freePractice2} Race name${this.next_race.raceName} Practice 3${freePractice3} Circuit name${this.next_race.Circuit.circuitName} Qualifying${qualifyingDate} diff --git a/src/cards/schedule.ts b/src/cards/schedule.ts index e5a2f30..0fc81f9 100644 --- a/src/cards/schedule.ts +++ b/src/cards/schedule.ts @@ -1,28 +1,30 @@ import { formatTime, HomeAssistant } from "custom-card-helpers"; import { html, HTMLTemplateResult } from "lit-html"; import { formatDate } from "../lib/format_date"; -import { FormulaOneCardConfig, Race } from "../types/formulaone-card-types"; +import { Circuit, FormulaOneCardConfig, Race } from "../types/formulaone-card-types"; import { BaseCard } from "./base-card"; export default class Schedule extends BaseCard { - - date_locale?: string; constructor(sensor: string, hass: HomeAssistant, config: FormulaOneCardConfig) { - super(sensor, hass); - - this.date_locale = config.date_locale; + super(sensor, hass, config); } + renderLocation(circuit: Circuit) { + const locationConcatted = `${circuit.Location.locality}, ${circuit.Location.country}`; + return this.config.location_clickable ? html`${locationConcatted}` : locationConcatted; + } + renderScheduleRow(race: Race): HTMLTemplateResult { const raceDate = new Date(race.date + 'T' + race.time); + const renderClass = this.config.previous_race && raceDate < new Date() ? this.config.previous_race : ''; return html` - + ${race.round} ${race.Circuit.circuitName} - ${race.Circuit.Location.locality}, ${race.Circuit.Location.country} - ${formatDate(raceDate, this.hass.locale, this.date_locale)} + ${this.renderLocation(race.Circuit)} + ${formatDate(raceDate, this.hass.locale, this.config.date_locale)} ${formatTime(raceDate, this.hass.locale)} `; } diff --git a/src/consts.ts b/src/consts.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/index.ts b/src/index.ts index e7b4bb1..2ab9822 100644 --- a/src/index.ts +++ b/src/index.ts @@ -56,9 +56,9 @@ export default class FormulaOneCard extends LitElement { renderCardType(): HTMLTemplateResult { switch(this.config.card_type) { case FormulaOneCardType.ConstructorStandings: - return new ConstructorStandings(this.config.sensor, this._hass).render(); + return new ConstructorStandings(this.config.sensor, this._hass, this.config).render(); case FormulaOneCardType.DriverStandings: - return new DriverStandings(this.config.sensor, this._hass).render(); + return new DriverStandings(this.config.sensor, this._hass, this.config).render(); case FormulaOneCardType.Schedule: return new Schedule(this.config.sensor, this._hass, this.config).render(); case FormulaOneCardType.NextRace: diff --git a/src/styles.ts b/src/styles.ts index fd38e9f..53d8645 100644 --- a/src/styles.ts +++ b/src/styles.ts @@ -32,4 +32,17 @@ export const style = css` .width-60 { width: 60px; } + .hide { + display: none; + } + .strikethrough { + text-decoration: line-through; + } + .italic { + font-style: italic; + } + a { + text-decoration: none; + color: var(--secondary-text-color); + } `; diff --git a/src/types/formulaone-card-types.ts b/src/types/formulaone-card-types.ts index bbed2b9..5eec67e 100644 --- a/src/types/formulaone-card-types.ts +++ b/src/types/formulaone-card-types.ts @@ -9,6 +9,15 @@ export interface FormulaOneCardConfig extends LovelaceCardConfig { sensor?: string; date_locale?: string; image_clickable?: boolean; + show_carnumber?: boolean; + location_clickable?: boolean; + previous_race?: PreviousRaceDisplay; +} + +export enum PreviousRaceDisplay { + Strikethrough = 'strikethrough', + Italic = 'italic', + Hide = 'hide' } export interface FormulaOneSensor { diff --git a/src/utils.ts b/src/utils.ts index 96a4fc0..f9425d8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import { HomeAssistant } from "custom-card-helpers"; import { PropertyValues } from "lit"; -import { FormulaOneCardConfig } from "./types/formulaone-card-types"; +import { Driver, FormulaOneCardConfig } from "./types/formulaone-card-types"; export const hasConfigOrEntitiesChanged = (node: FormulaOneCardConfig, changedProps: PropertyValues) => { if (changedProps.has('config')) { @@ -34,4 +34,9 @@ export const getCountryFlagUrl = (countryDashed: string) => { } return `https://www.countries-ofthe-world.com/flags-normal/flag-of-${countryDashed}.png`; +} + +export const getDriverName = (driver: Driver, config: FormulaOneCardConfig) => { + const permanentNumber = driver.code == 'VER' ? 1 : driver.permanentNumber; + return `${driver.givenName} ${driver.familyName}${(config.show_carnumber ? ` #${permanentNumber}` : '')}`; } \ No newline at end of file diff --git a/tests/cards/constructor-standings.test.ts b/tests/cards/constructor-standings.test.ts index 9edabff..add6dd5 100644 --- a/tests/cards/constructor-standings.test.ts +++ b/tests/cards/constructor-standings.test.ts @@ -5,19 +5,20 @@ import { HomeAssistant } from 'custom-card-helpers'; import { getRenderString } from '../utils'; import { MRData } from '../testdata/constructorStandings.json' import { HassEntity } from 'home-assistant-js-websocket'; -import { ConstructorStanding } from '../../src/types/formulaone-card-types'; +import { ConstructorStanding, FormulaOneCardConfig } from '../../src/types/formulaone-card-types'; describe('Testing constructor-standings file', () => { const hass = createMock(); const data = MRData['StandingsTable']['StandingsLists'][0]['ConstructorStandings']; const hassEntity = createMock(); + const config = createMock(); test('Calling render with hass and wrong sensor', () => { hass.states = { 'sensor.test_sensor_wrong_sensor': hassEntity }; - const card = new ConstructorStandings('sensor.test_sensor_wrong_sensor', hass); + const card = new ConstructorStandings('sensor.test_sensor_wrong_sensor', hass, config); expect(() => card.render()).toThrowError('Please pass the correct sensor (constructors)'); }), test('Calling render with hass and sensor but no data', () => { @@ -26,7 +27,7 @@ describe('Testing constructor-standings file', () => { 'sensor.test_sensor_constructors': hassEntity }; - const card = new ConstructorStandings('sensor.test_sensor_constructors', hass); + const card = new ConstructorStandings('sensor.test_sensor_constructors', hass, config); expect(() => card.render()).toThrowError('Please pass the correct sensor (constructors)'); }), test('Calling render with hass and sensor', () => { @@ -35,7 +36,7 @@ describe('Testing constructor-standings file', () => { 'sensor.test_sensor_constructors': hassEntity }; - const card = new ConstructorStandings('sensor.test_sensor_constructors', hass); + const card = new ConstructorStandings('sensor.test_sensor_constructors', hass, config); const result = card.render(); const htmlResult = getRenderString(result); diff --git a/tests/cards/driver-standings.test.ts b/tests/cards/driver-standings.test.ts index fc1c824..dff9131 100644 --- a/tests/cards/driver-standings.test.ts +++ b/tests/cards/driver-standings.test.ts @@ -5,19 +5,20 @@ import { HomeAssistant } from 'custom-card-helpers'; import { getRenderString } from '../utils'; import { MRData } from '../testdata/driverStandings.json' import { HassEntity } from 'home-assistant-js-websocket'; -import { DriverStanding } from '../../src/types/formulaone-card-types'; +import { DriverStanding, FormulaOneCardConfig } from '../../src/types/formulaone-card-types'; describe('Testing driver-standings file', () => { const hass = createMock(); const data = MRData['StandingsTable']['StandingsLists'][0]['DriverStandings']; const hassEntity = createMock(); + const config = createMock(); test('Calling render with hass and wrong sensor', () => { hass.states = { 'sensor.test_sensor_wrong_sensor': hassEntity }; - const card = new DriverStandings('sensor.test_sensor_wrong_sensor', hass); + const card = new DriverStandings('sensor.test_sensor_wrong_sensor', hass, config); expect(() => card.render()).toThrowError('Please pass the correct sensor (drivers)'); }), test('Calling render with hass and sensor but no data', () => { @@ -26,7 +27,7 @@ describe('Testing driver-standings file', () => { 'sensor.test_sensor_drivers': hassEntity }; - const card = new DriverStandings('sensor.test_sensor_drivers', hass); + const card = new DriverStandings('sensor.test_sensor_drivers', hass, config); expect(() => card.render()).toThrowError('Please pass the correct sensor (drivers)'); }), test('Calling render with hass and sensor', () => { @@ -35,7 +36,7 @@ describe('Testing driver-standings file', () => { 'sensor.test_sensor_drivers': hassEntity }; - const card = new DriverStandings('sensor.test_sensor_drivers', hass); + const card = new DriverStandings('sensor.test_sensor_drivers', hass, config); const result = card.render(); const htmlResult = getRenderString(result); diff --git a/tests/cards/schedule.test.ts b/tests/cards/schedule.test.ts index b606007..2c29f1b 100644 --- a/tests/cards/schedule.test.ts +++ b/tests/cards/schedule.test.ts @@ -5,9 +5,10 @@ import { HomeAssistant, NumberFormat, TimeFormat } from 'custom-card-helpers'; import { getRenderString } from '../utils'; import { MRData } from '../testdata/schedule.json' import { HassEntity } from 'home-assistant-js-websocket'; -import { FormulaOneCardConfig, Race } from '../../src/types/formulaone-card-types'; +import { FormulaOneCardConfig, PreviousRaceDisplay, Race } from '../../src/types/formulaone-card-types'; describe('Testing schedule file', () => { + const hass = createMock(); hass.locale = { language: 'NL', @@ -46,6 +47,43 @@ describe('Testing schedule file', () => { const result = card.render(); const htmlResult = getRenderString(result); - expect(htmlResult).toMatch('
  Race Location Date Time
1 Bahrain International Circuit Sakhir, Bahrain 20-03 16:00
2 Jeddah Corniche Circuit Jeddah, Saudi Arabia 27-03 19:00
3 Albert Park Grand Prix Circuit Melbourne, Australia 10-04 7:00
4 Autodromo Enzo e Dino Ferrari Imola, Italy 24-04 15:00
5 Miami International Autodrome Miami, USA 08-05 21:30
6 Circuit de Barcelona-Catalunya Montmeló, Spain 22-05 15:00
7 Circuit de Monaco Monte-Carlo, Monaco 29-05 15:00
8 Baku City Circuit Baku, Azerbaijan 12-06 13:00
9 Circuit Gilles Villeneuve Montreal, Canada 19-06 20:00
10 Silverstone Circuit Silverstone, UK 03-07 16:00
11 Red Bull Ring Spielberg, Austria 10-07 15:00
12 Circuit Paul Ricard Le Castellet, France 24-07 15:00
13 Hungaroring Budapest, Hungary 31-07 15:00
14 Circuit de Spa-Francorchamps Spa, Belgium 28-08 15:00
15 Circuit Park Zandvoort Zandvoort, Netherlands 04-09 15:00
16 Autodromo Nazionale di Monza Monza, Italy 11-09 15:00
17 Marina Bay Street Circuit Marina Bay, Singapore 02-10 14:00
18 Suzuka Circuit Suzuka, Japan 09-10 7:00
19 Circuit of the Americas Austin, USA 23-10 21:00
20 Autódromo Hermanos Rodríguez Mexico City, Mexico 30-10 21:00
21 Autódromo José Carlos Pace São Paulo, Brazil 13-11 19:00
22 Yas Marina Circuit Abu Dhabi, UAE 20-11 14:00
'); + expect(htmlResult).toMatch('
  Race Location Date Time
1 Bahrain International Circuit Sakhir, Bahrain 20-03 16:00
2 Jeddah Corniche Circuit Jeddah, Saudi Arabia 27-03 19:00
3 Albert Park Grand Prix Circuit Melbourne, Australia 10-04 7:00
4 Autodromo Enzo e Dino Ferrari Imola, Italy 24-04 15:00
5 Miami International Autodrome Miami, USA 08-05 21:30
6 Circuit de Barcelona-Catalunya Montmeló, Spain 22-05 15:00
7 Circuit de Monaco Monte-Carlo, Monaco 29-05 15:00
8 Baku City Circuit Baku, Azerbaijan 12-06 13:00
9 Circuit Gilles Villeneuve Montreal, Canada 19-06 20:00
10 Silverstone Circuit Silverstone, UK 03-07 16:00
11 Red Bull Ring Spielberg, Austria 10-07 15:00
12 Circuit Paul Ricard Le Castellet, France 24-07 15:00
13 Hungaroring Budapest, Hungary 31-07 15:00
14 Circuit de Spa-Francorchamps Spa, Belgium 28-08 15:00
15 Circuit Park Zandvoort Zandvoort, Netherlands 04-09 15:00
16 Autodromo Nazionale di Monza Monza, Italy 11-09 15:00
17 Marina Bay Street Circuit Marina Bay, Singapore 02-10 14:00
18 Suzuka Circuit Suzuka, Japan 09-10 7:00
19 Circuit of the Americas Austin, USA 23-10 21:00
20 Autódromo Hermanos Rodríguez Mexico City, Mexico 30-10 21:00
21 Autódromo José Carlos Pace São Paulo, Brazil 13-11 19:00
22 Yas Marina Circuit Abu Dhabi, UAE 20-11 14:00
'); + }), + test('Calling render with hass and sensor and location clickable', () => { + hassEntity.attributes['data'] = data as Race[]; + hass.states = { + 'sensor.test_sensor_races': hassEntity + }; + + config.location_clickable = true; + const card = new Schedule('sensor.test_sensor_races', hass, config); + const result = card.render(); + const htmlResult = getRenderString(result); + + expect(htmlResult).toMatch('
  Race Location Date Time
1 Bahrain International Circuit Sakhir, Bahrain 20-03 16:00
2 Jeddah Corniche Circuit Jeddah, Saudi Arabia 27-03 19:00
3 Albert Park Grand Prix Circuit Melbourne, Australia 10-04 7:00
4 Autodromo Enzo e Dino Ferrari Imola, Italy 24-04 15:00
5 Miami International Autodrome Miami, USA 08-05 21:30
6 Circuit de Barcelona-Catalunya Montmeló, Spain 22-05 15:00
7 Circuit de Monaco Monte-Carlo, Monaco 29-05 15:00
8 Baku City Circuit Baku, Azerbaijan 12-06 13:00
9 Circuit Gilles Villeneuve Montreal, Canada 19-06 20:00
10 Silverstone Circuit Silverstone, UK 03-07 16:00
11 Red Bull Ring Spielberg, Austria 10-07 15:00
12 Circuit Paul Ricard Le Castellet, France 24-07 15:00
13 Hungaroring Budapest, Hungary 31-07 15:00
14 Circuit de Spa-Francorchamps Spa, Belgium 28-08 15:00
15 Circuit Park Zandvoort Zandvoort, Netherlands 04-09 15:00
16 Autodromo Nazionale di Monza Monza, Italy 11-09 15:00
17 Marina Bay Street Circuit Marina Bay, Singapore 02-10 14:00
18 Suzuka Circuit Suzuka, Japan 09-10 7:00
19 Circuit of the Americas Austin, USA 23-10 21:00
20 Autódromo Hermanos Rodríguez Mexico City, Mexico 30-10 21:00
21 Autódromo José Carlos Pace São Paulo, Brazil 13-11 19:00
22 Yas Marina Circuit Abu Dhabi, UAE 20-11 14:00
'); + }), + test.each` + previous_race + ${PreviousRaceDisplay.Hide} + ${PreviousRaceDisplay.Strikethrough} + ${PreviousRaceDisplay.Italic} + `('Calling render with hass and sensor and previous race', ({ previous_race }) => { + + jest.useFakeTimers(); + jest.setSystemTime(new Date(2022, 3, 1)); // Weird bug in jest setting this to the last of the month + + hassEntity.attributes['data'] = data as Race[]; + hass.states = { + 'sensor.test_sensor_races': hassEntity + }; + + config.previous_race = previous_race; + const card = new Schedule('sensor.test_sensor_races', hass, config); + const result = card.render(); + const htmlResult = getRenderString(result); + + jest.useRealTimers(); + + expect(htmlResult).toMatch(`
  Race Location Date Time
1 Bahrain International Circuit Sakhir, Bahrain 20-03 16:00
2 Jeddah Corniche Circuit Jeddah, Saudi Arabia 27-03 19:00
3 Albert Park Grand Prix Circuit Melbourne, Australia 10-04 7:00
4 Autodromo Enzo e Dino Ferrari Imola, Italy 24-04 15:00
5 Miami International Autodrome Miami, USA 08-05 21:30
6 Circuit de Barcelona-Catalunya Montmeló, Spain 22-05 15:00
7 Circuit de Monaco Monte-Carlo, Monaco 29-05 15:00
8 Baku City Circuit Baku, Azerbaijan 12-06 13:00
9 Circuit Gilles Villeneuve Montreal, Canada 19-06 20:00
10 Silverstone Circuit Silverstone, UK 03-07 16:00
11 Red Bull Ring Spielberg, Austria 10-07 15:00
12 Circuit Paul Ricard Le Castellet, France 24-07 15:00
13 Hungaroring Budapest, Hungary 31-07 15:00
14 Circuit de Spa-Francorchamps Spa, Belgium 28-08 15:00
15 Circuit Park Zandvoort Zandvoort, Netherlands 04-09 15:00
16 Autodromo Nazionale di Monza Monza, Italy 11-09 15:00
17 Marina Bay Street Circuit Marina Bay, Singapore 02-10 14:00
18 Suzuka Circuit Suzuka, Japan 09-10 7:00
19 Circuit of the Americas Austin, USA 23-10 21:00
20 Autódromo Hermanos Rodríguez Mexico City, Mexico 30-10 21:00
21 Autódromo José Carlos Pace São Paulo, Brazil 13-11 19:00
22 Yas Marina Circuit Abu Dhabi, UAE 20-11 14:00
`); }) }); \ No newline at end of file diff --git a/tests/lib/formate_date_time.test.ts b/tests/lib/formate_date_time.test.ts index 948dc26..35fc336 100644 --- a/tests/lib/formate_date_time.test.ts +++ b/tests/lib/formate_date_time.test.ts @@ -11,36 +11,42 @@ describe('Testing formate_date_time file', () => { test('Passing date, locale formatDateTime', () => { const date = new Date('2022-01-01 10:00:00') - expect(formatDateTime(date, locale)).toBe('1 januari 2022 om 10:00'); + const result = formatDateTime(date, locale).split(' '); + '1 januari 2022 10:00'.split(' ').forEach((x: string) => expect(result).toContain(x)); }), test('Passing date and locale formatDateTimeRaceInfo', () => { const date = new Date('2022-01-01 10:00:00') - - expect(formatDateTimeRaceInfo(date, locale)).toBe('za 10:00'); + + const result = formatDateTimeRaceInfo(date, locale).split(' '); + 'za 10:00'.split(' ').forEach((x: string) => expect(result).toContain(x)); }), test('Passing date, locale and en locale formatDateTime', () => { const date = new Date('2022-01-01 10:00:00') locale.time_format = TimeFormat.am_pm; - - expect(formatDateTime(date, locale)).toBe('1 januari 2022 om 10:00 a.m.'); + + const result = formatDateTime(date, locale).split(' '); + '1 januari 2022 10:00 a.m.'.split(' ').forEach((x: string) => expect(result).toContain(x)); }), test('Passing date and locale en locale formatDateTimeRaceInfo', () => { const date = new Date('2022-01-01 10:00:00') locale.time_format = TimeFormat.am_pm; - expect(formatDateTimeRaceInfo(date, locale)).toBe('za 10:00 a.m.'); + const result = formatDateTimeRaceInfo(date, locale).split(' '); + 'za 10:00 a.m.'.split(' ').forEach((x: string) => expect(result).toContain(x)); }), test('Passing date, locale and timeformat system formatDateTime', () => { const date = new Date('2022-01-01 10:00:00') locale.time_format = TimeFormat.system; - expect(formatDateTime(date, locale)).toBe('1 januari 2022 om 10:00 a.m.'); + const result = formatDateTime(date, locale).split(' '); + '1 januari 2022 10:00'.split(' ').forEach((x: string) => expect(result).toContain(x)); }), test('Passing date and locale timeformat system formatDateTimeRaceInfo', () => { const date = new Date('2022-01-01 10:00:00') locale.time_format = TimeFormat.system; - expect(formatDateTimeRaceInfo(date, locale)).toBe('za 10:00 a.m.'); + const result = formatDateTimeRaceInfo(date, locale).split(' '); + 'za 10:00'.split(' ').forEach((x: string) => expect(result).toContain(x)); }) }) diff --git a/tests/utils/getDriverName.test.ts b/tests/utils/getDriverName.test.ts new file mode 100644 index 0000000..889ba61 --- /dev/null +++ b/tests/utils/getDriverName.test.ts @@ -0,0 +1,26 @@ +import { createMock } from 'ts-auto-mock'; +import { Driver, FormulaOneCardConfig } from '../../src/types/formulaone-card-types'; +import { getDriverName } from '../../src/utils'; + +describe('Testing util file function getDriverName', () => { + const config = createMock(); + const driver: Driver = { + familyName: 'Verstappen', + givenName: 'Max', + permanentNumber: '1', + driverId: '', + code: 'VER', + url: '', + dateOfBirth: '', + nationality: '' + }; + + test('Passing driver and config with show_carnumber should return expected driver name', () => { + expect(getDriverName(driver, config)).toBe('Max Verstappen') + }), + test('Passing driver and config with show_carnumber should return expected driver name', () => { + config.show_carnumber = true; + expect(getDriverName(driver, config)).toBe('Max Verstappen #1') + }) +}) +