= {
- show_current: true,
- default_forecast: "daily",
- forecast: {
- show_sun_times: true,
- },
- forecast_action: {
- tap_action: { action: "toggle-forecast" },
- },
- tap_action: { action: "more-info" },
- };
+ if (config.show_current === false && config.show_forecast === false) {
+ throw new Error(
+ "At least one of show_current or show_forecast must be true"
+ );
+ }
- this.config = merge(defaults, config);
+ this.config = merge({}, DEFAULT_CONFIG, config);
this._currentForecastType = this.config.default_forecast || "daily";
}
@@ -179,39 +210,42 @@ export class WeatherForecastCard extends LitElement {
>
`
: nothing}
-
- ${isChartMode
- ? html`
-
- `
- : html`
-
- `}
-
+ ${this.config.show_forecast === false
+ ? nothing
+ : html`
+ ${isChartMode
+ ? html`
+
+ `
+ : html`
+
+ `}
+
`}
`;