Skip to content

Commit

Permalink
Entity config: Don't show device panel when no project available (#190)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Dec 26, 2024
1 parent 2582acf commit 1da47f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/knx-group-address-selector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class GroupAddressSelector extends LitElement {
@queryAll("ha-selector-select") private _gaSelectors!: NodeListOf<HTMLElement>;

getValidGroupAddresses(validDPTs: DPT[]): GroupAddress[] {
return this.knx.project
return this.knx.project?.project_loaded
? Object.values(this.knx.project.knxproject.group_addresses).filter((groupAddress) =>
groupAddress.dpt ? isValidDPT(groupAddress.dpt, validDPTs) : false,
)
Expand Down
2 changes: 1 addition & 1 deletion src/views/entities_create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class KNXCreateEntity extends LitElement {
<ha-svg-icon slot="icon" .path=${create ? mdiPlus : mdiFloppy}></ha-svg-icon>
</ha-fab>
</div>
${this.knx.project
${this.knx.project?.project_loaded
? html` <div class="panel">
<knx-project-device-tree
.data=${this.knx.project.knxproject}
Expand Down

0 comments on commit 1da47f1

Please sign in to comment.