home dashboard: Allow users to choose weather entity if they have more than one (#27643)

This commit is contained in:
Tobias Bieniek 2025-10-29 11:36:05 +01:00 committed by GitHub
parent c0cc66c1ab
commit 505ef2bd11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -216,7 +216,9 @@ export class HomeMainViewStrategy extends ReactiveElement {
column_span: maxColumns,
cards: [],
};
const weatherEntity = Object.keys(hass.states).find(weatherFilter);
const weatherEntity = Object.keys(hass.states)
.filter(weatherFilter)
.sort()[0];
if (weatherEntity) {
widgetSection.cards!.push(