mirror of
https://github.com/esphome/esphome.git
synced 2024-11-14 02:58:11 +01:00
Fix bug when requesting italic gfonts (#5623)
This commit is contained in:
parent
1282a15b14
commit
f96a839bcf
1 changed files with 4 additions and 5 deletions
|
@ -137,11 +137,10 @@ def validate_weight_name(value):
|
||||||
|
|
||||||
|
|
||||||
def download_gfonts(value):
|
def download_gfonts(value):
|
||||||
wght = value[CONF_WEIGHT]
|
name = (
|
||||||
if value[CONF_ITALIC]:
|
f"{value[CONF_FAMILY]}:ital,wght@{int(value[CONF_ITALIC])},{value[CONF_WEIGHT]}"
|
||||||
wght = f"1,{wght}"
|
)
|
||||||
name = f"{value[CONF_FAMILY]}@{value[CONF_WEIGHT]}"
|
url = f"https://fonts.googleapis.com/css2?family={name}"
|
||||||
url = f"https://fonts.googleapis.com/css2?family={value[CONF_FAMILY]}:wght@{wght}"
|
|
||||||
|
|
||||||
path = _compute_gfonts_local_path(value)
|
path = _compute_gfonts_local_path(value)
|
||||||
if path.is_file():
|
if path.is_file():
|
||||||
|
|
Loading…
Reference in a new issue