Skip to content

Commit

Permalink
Automatically fill mandatory fields in YAML card configuration (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkissling authored Oct 2, 2023
1 parent a77dd00 commit 15f257f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/clock-weather-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ export class ClockWeatherCard extends LitElement {
setTimeout(() => { this.currentDate = new Date() }, msToNextMinute);
}

public static getStubConfig(): Record<string, unknown> {
public static getStubConfig(_hass: HomeAssistant, entities: string[], entitiesFallback: string[]): Record<string, unknown> {
const entity = entities.find(e => e.startsWith('weather.') ?? entitiesFallback.find(e => e.startsWith));
if (entity) {
return { entity };
}

return {};
}

Expand Down

0 comments on commit 15f257f

Please sign in to comment.