-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.ts
More file actions
28 lines (23 loc) · 916 Bytes
/
Copy pathmain.ts
File metadata and controls
28 lines (23 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import { defineCustomElement } from 'vue'
import LCARSCardCe from './LCARSCard.ce.vue'
import { LCARSCustomCard } from './LCARSCustomCard.ts'
import { registerAllComponents } from './ComponentRegistry.ts'
import './editor.ts'
import { LCARSCustomLayout } from './LCARSCustomLayout.ts'
customElements.define('lcars-card', defineCustomElement(LCARSCardCe))
;(window as any).customCards = (window as any).customCards || []
if (!(window as any).customCards.some((card: any) => card.type === 'ha-lcars-panel')) {
;(window as any).customCards.push({
type: 'ha-lcars-panel',
name: 'LCARS Custom Panel',
preview: true,
description: 'LCARS Custom Panel',
})
}
if (!customElements.get('ha-lcars-panel')) {
customElements.define('ha-lcars-panel', LCARSCustomCard)
}
if (!customElements.get('ha-lcars-layout')) {
customElements.define('ha-lcars-layout', LCARSCustomLayout)
}
registerAllComponents()