mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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 (
|
if (
|
||||||
!config.forecast_type ||
|
!config.forecast_type ||
|
||||||
|
(config.forecast_type === "legacy" && this._modernForecastSupported()) ||
|
||||||
!this._forecastSupported(config.forecast_type)
|
!this._forecastSupported(config.forecast_type)
|
||||||
) {
|
) {
|
||||||
let forecastType: string | undefined;
|
let forecastType: string | undefined;
|
||||||
@ -114,6 +115,14 @@ export class HuiWeatherForecastCardEditor
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _modernForecastSupported(): boolean {
|
||||||
|
return (
|
||||||
|
this._forecastSupported("daily") ||
|
||||||
|
this._forecastSupported("hourly") ||
|
||||||
|
this._forecastSupported("twice_daily")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
private _schema = memoizeOne(
|
private _schema = memoizeOne(
|
||||||
(
|
(
|
||||||
localize: LocalizeFunc,
|
localize: LocalizeFunc,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user