-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathindex.ts
More file actions
36 lines (31 loc) · 1.34 KB
/
Copy pathindex.ts
File metadata and controls
36 lines (31 loc) · 1.34 KB
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
29
30
31
32
33
34
35
36
import { AnimatedWeatherCard } from './components/card';
import { DynamicWeatherCardEditor } from './components/editor';
import { VERSION } from './constants';
import type { CustomCardRegistration } from './types';
export { i18n } from './internationalization/index';
export { t } from './internationalization/directive';
export { resolveLanguage } from './internationalization/resolveLanguage';
// Register custom elements
try {
customElements.define('dynamic-weather-card', AnimatedWeatherCard);
customElements.define('dynamic-weather-card-editor', DynamicWeatherCardEditor);
// Log version info
console.log(
`%cDynamic Weather Card %c${VERSION}`,
'color: #007AFF; font-weight: bold; font-size: 14px;',
'color: #666; font-size: 12px;',
'\nДинамическая карточка погоды'
);
// Register with Home Assistant
window.customCards = window.customCards || [];
const cardRegistration: CustomCardRegistration = {
type: 'dynamic-weather-card',
name: 'Dynamic Weather Card',
description: 'Динамическая карточка погоды',
preview: true,
documentationURL: 'https://github.com/teuchezh/dynamic-weather-card'
};
window.customCards.push(cardRegistration);
} catch (error) {
console.error('❌ Ошибка при регистрации Dynamic Weather Card:', error);
}