Skip to content

Commit

Permalink
Await knx object initialisation (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Sep 4, 2024
1 parent c51e93e commit 44a9d27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@ class KnxFrontend extends knxElement {

@property({ attribute: false }) public route!: Route;

protected firstUpdated(_changedProps) {
protected async firstUpdated(_changedProps) {
if (!this.hass) {
return;
}
if (!this.knx) {
this._initKnx();
await this._initKnx();
}
this.addEventListener("knx-location-changed", (e) => this._setRoute(e as LocationChangedEvent));

this.addEventListener("knx-reload", (_) => {
this.addEventListener("knx-reload", async (_) => {
this.knx.log.debug("Reloading KNX object");
this._initKnx();
await this._initKnx();
});

computeDirectionStyles(computeRTL(this.hass), this.parentElement as LitElement);
Expand Down

0 comments on commit 44a9d27

Please sign in to comment.