mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix reselecting forecast type in weather forecast card editor (#17652)
Co-authored-by: Simon Lamon <32477463+silamon@users.noreply.github.com> Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
5f015ac9af
commit
c76b2fb357
@ -58,6 +58,7 @@ export class HuiWeatherForecastCardEditor
|
||||
}
|
||||
if (
|
||||
!config.forecast_type ||
|
||||
(config.forecast_type === "legacy" && this._modernForecastSupported()) ||
|
||||
!this._forecastSupported(config.forecast_type)
|
||||
) {
|
||||
let forecastType: string | undefined;
|
||||
@ -114,6 +115,14 @@ export class HuiWeatherForecastCardEditor
|
||||
return false;
|
||||
}
|
||||
|
||||
private _modernForecastSupported(): boolean {
|
||||
return (
|
||||
this._forecastSupported("daily") ||
|
||||
this._forecastSupported("hourly") ||
|
||||
this._forecastSupported("twice_daily")
|
||||
);
|
||||
}
|
||||
|
||||
private _schema = memoizeOne(
|
||||
(
|
||||
localize: LocalizeFunc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user