Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/editor/StrategyEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1421,6 +1421,9 @@ class Simon42DashboardStrategyEditor extends LitElement {
const showLocksInRooms = this._config.show_locks_in_rooms === true;
const showAutomationsInRooms = this._config.show_automations_in_rooms === true;
const showScriptsInRooms = this._config.show_scripts_in_rooms === true;
// Window / door contact badges default to visible — read as opt-out (!== false).
const showWindowContactsInRooms = this._config.show_window_contacts_in_rooms !== false;
const showDoorContactsInRooms = this._config.show_door_contacts_in_rooms !== false;
const useDefaultAreaSort = this._config.use_default_area_sort === true;

const allAreas = Object.values(this._hass!.areas).sort((a, b) => a.name.localeCompare(b.name));
Expand Down Expand Up @@ -1455,6 +1458,14 @@ class Simon42DashboardStrategyEditor extends LitElement {
(checked) => this._toggleChanged('show_scripts_in_rooms', checked, false))}
<div class="description">${localize('editor.show_scripts_in_rooms_desc')}</div>

${this._renderCheckbox('show-window-contacts-in-rooms', localize('editor.show_window_contacts_in_rooms'), showWindowContactsInRooms,
(checked) => this._toggleChanged('show_window_contacts_in_rooms', checked, true))}
<div class="description">${localize('editor.show_window_contacts_in_rooms_desc')}</div>

${this._renderCheckbox('show-door-contacts-in-rooms', localize('editor.show_door_contacts_in_rooms'), showDoorContactsInRooms,
(checked) => this._toggleChanged('show_door_contacts_in_rooms', checked, true))}
<div class="description">${localize('editor.show_door_contacts_in_rooms_desc')}</div>

${this._renderCheckbox('use-default-area-sort', localize('editor.use_default_area_sort'), useDefaultAreaSort,
(checked) => this._toggleChanged('use_default_area_sort', checked, false))}
<div class="description">${localize('editor.use_default_area_sort_desc')}</div>
Expand Down
4 changes: 2 additions & 2 deletions src/types/strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export interface Simon42StrategyConfig {
show_locks_in_rooms?: boolean; // default: false
show_automations_in_rooms?: boolean; // default: false
show_scripts_in_rooms?: boolean; // default: false
show_window_contacts_in_rooms?: boolean; // default: false
show_door_contacts_in_rooms?: boolean; // default: false
show_window_contacts_in_rooms?: boolean; // default: true (opt-out — set false to hide window contact badges)
show_door_contacts_in_rooms?: boolean; // default: true (opt-out — set false to hide door contact badges)
show_switches_on_areas?: boolean; // default: false
show_alerts_on_areas?: boolean; // default: false
energy_link_dashboard?: boolean; // default: true
Expand Down
10 changes: 8 additions & 2 deletions src/views/RoomViewStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,14 @@ class Simon42ViewRoomStrategy extends HTMLElement {
}

// Window/door: show ALL matches (not just first), users control via per-area hidden[]
for (const id of sensorEntities.window) addCandidate(id, 'window', 'window');
for (const id of sensorEntities.door) addCandidate(id, 'door', 'door');
// Per-domain opt-out via show_window_contacts_in_rooms / show_door_contacts_in_rooms
// (default true — preserves prior behavior; set false to silence the badge type).
if (dashboardConfig.show_window_contacts_in_rooms !== false) {
for (const id of sensorEntities.window) addCandidate(id, 'window', 'window');
}
if (dashboardConfig.show_door_contacts_in_rooms !== false) {
for (const id of sensorEntities.door) addCandidate(id, 'door', 'door');
}

// Apply per-area badge config: filter hidden, append additional
let filteredCandidates = candidates;
Expand Down