nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
30 stars 9 forks source link

[FR] Make height set automatically to get a square card #72

Open ildar170975 opened 3 months ago

ildar170975 commented 3 months ago

Consider the code:

type: custom:map-card
entities:
  - entity: zone.home
card_size: 8.65

A value for card_size was defined to make the card looking square - like a stock map card: image

On that picture:

After resizing the window: image

A height of ha-map card is ~452px and it seems to be constant: https://github.com/nathan-gs/ha-map-card/blob/e72bfb131835983ed9c3ee5a637da8a70d29ebb8/src/configs/MapConfig.js#L122

Is it possible to provide smth like

card_size: auto

possible value (and may be even make it a default value) to set "height = width" to get a square card? Ofc a "title is defined" case should be considered as well.