Skip to content

Commit 716db2d

Browse files
committed
update custom elements definition
1 parent 9036363 commit 716db2d

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/cards/card.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ export class AdGuardCard extends LitElement {
9191
</ha-card>`;
9292
}
9393

94+
if (!this._setup || !this._setup.holes || this._setup.holes.length === 0) {
95+
return html`<ha-card>
96+
<div class="card-content">
97+
<div class="no-setup">No instances found</div>
98+
</div>
99+
</ha-card>`;
100+
}
101+
94102
return renderAdGuardCard(this, this._hass, this._setup, this._config);
95103
}
96104
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { SystemMetricsGraph } from '@html/components/system-metrics-graph';
55
import { version } from '../package.json';
66

77
// Register the custom elements with the browser
8-
customElements.define('adguard', AdGuardCard);
8+
customElements.define('adguard-card', AdGuardCard);
99
customElements.define('adguard-editor', AdGuardCardEditor);
1010
customElements.define('adguard-pause-component', PauseComponent);
1111
customElements.define('adguard-system-metrics-graph', SystemMetricsGraph);

test/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('index.ts', () => {
3434
it('should register all custom elements', () => {
3535
require('@/index.ts');
3636
expect(customElementsStub.callCount).to.equal(4);
37-
expect(customElementsStub.firstCall.args[0]).to.equal('adguard');
37+
expect(customElementsStub.firstCall.args[0]).to.equal('adguard-card');
3838
expect(customElementsStub.secondCall.args[0]).to.equal('adguard-editor');
3939
expect(customElementsStub.thirdCall.args[0]).to.equal(
4040
'adguard-pause-component',

0 commit comments

Comments
 (0)