Skip to content

Commit

Permalink
allow to find screen also by id
Browse files Browse the repository at this point in the history
  • Loading branch information
tibroc committed Feb 28, 2025
1 parent b45344a commit 17f7fb9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions appliance-application/packages/main/src/displayManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class DisplayManager {
return this.displays;
}

public getDisplay(label: string): Display | null {
return this.displays.find(display => display.label === label) || null;
public getDisplay(identifier: string | number): Display | null {
return this.displays.find(display => display.id === identifier || display.label === identifier) || null;
}
}
6 changes: 5 additions & 1 deletion appliance-application/packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ function loadDisplays() {

const allDisplays = displayManager.getDisplays();
allDisplays.forEach(display => {
console.log(`Found display '${display.label}'`);
console.log('Found display with display attributes:', {
id: display.id,
label: display.label,
size: display.size
});
});
}

Expand Down

0 comments on commit 17f7fb9

Please sign in to comment.