diff --git a/README.md b/README.md index dfa46cc..3433fc7 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ type: "custom:carnet-card" car_id: passat_gte_2020 # your car identifer in home assistant (e.g. binary_sensor.passat_gte_2020_climatisation_without_external_power) slice_url: https://images.portal.volkswagen-we.com/slices/passat_variant_gte_pa/passat_variant_gte_pa # either you can extract this url from the logs of the homeassistant-volkswagencarnet plugin or use the dev tools and debug the portal.volkswagen-we.com website. +scale: 0.5 # optional (if you want the card to be smaller) +height: 270px # optional (if you want the card to be smaller) ``` ## Development diff --git a/carnet-card.js b/carnet-card.js index bd25f20..728332b 100644 --- a/carnet-card.js +++ b/carnet-card.js @@ -1,9 +1,19 @@ class CarnetCard extends HTMLElement { set hass(hass) { if (!this.content) { + const scale = this.config.scale; + const height = this.config.height; + const card = document.createElement("ha-card"); this.content = document.createElement("div"); this.content.style.width = "100%"; + if (!!height) { + this.content.style.height = `${height}`; + } + if (!!scale) { + this.content.style.transform = `scale(${scale})`; + } + this.content.style.transformOrigin = "top center"; card.appendChild(this.content); this.appendChild(card); }