scaling_mode
is the MeteoalarmCard configuration option introduced in version
v2.4.0
. Card scaling
is a module responsible for swapping headlines or reducing their size to ensure that whole
headline is always visible. scaling_mode
option controls behaviour of said module.
While rendering the card, MeteoalarmCard prepares three headlines. For example:
- Provided by integration: Snowfall Warning
- Long generated: Yellow snow/ice warning
- Short generated: Snow/ice
The card then decided which headline to display at which size. When override_headline
is enabled,
the first headline is omitted. Depending on the current width of the card and scaling_mode
, the card will
try to swap these headlines, reduce their size, or both. This may cause you to see different
headlines on different devices.
This option can be configured in four different ways.
scaling_mode: headline_and_scale
The card will both use headline swapping and scaling. The card will try to find a headline that fits the current card size even when it means reducing its font size. This is the default configuration option.
scaling_mode: headline
The scaling module will try to find a headline that fits the current card size without changing the headline font size. This is pre-2.4.0 behavior.
scaling_mode: scale
The card will always use the first headline (provided by integration or long auto-generated) and scale it to the current card size. When scaling hits a lower limit, the headline will be truncated to fit.
scaling_mode: disabled
Scaling module is disabled. Card will always use first headline (provided by integration or long auto-generated) and truncate it to fit.