extra-map-card 1.6.2 → 1.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/emc-entity-editor.d.ts +1 -1
- package/dist/constants/map-schema.d.ts +130 -79
- package/dist/extra-map-card-bundle.js +46 -40
- package/dist/extra-map-card.d.ts +10 -1
- package/dist/extra-map-editor.d.ts +3 -1
- package/dist/index.js +46 -40
- package/dist/types/config.d.ts +1 -0
- package/dist/types/ha-frontend/common/datetime/format_date.d.ts +12 -0
- package/dist/types/ha-frontend/common/datetime/format_date_time.d.ts +9 -0
- package/dist/types/ha-frontend/common/datetime/format_time.d.ts +6 -0
- package/dist/types/ha-frontend/common/datetime/resolve-time-zone.d.ts +3 -0
- package/dist/types/ha-frontend/common/datetime/seconds_to_duration.d.ts +1 -0
- package/dist/types/ha-frontend/common/datetime/use_am_pm.d.ts +2 -0
- package/dist/types/ha-frontend/common/entity/compute_domain.d.ts +1 -0
- package/dist/types/ha-frontend/common/entity/compute_state_domain.d.ts +2 -0
- package/dist/types/ha-frontend/common/translations/localize.d.ts +1 -0
- package/dist/types/ha-frontend/data/{frontend-local-data.d.ts → translation.d.ts} +10 -0
- package/dist/types/ha-frontend/data/ws-templates.d.ts +1 -0
- package/dist/types/ha-frontend/home-assistant.d.ts +1 -1
- package/dist/types/ha-frontend/lovelace/lovelace.d.ts +11 -23
- package/dist/types/index.d.ts +4 -1
- package/dist/utilities/find-entities.d.ts +1 -1
- package/package.json +7 -5
package/dist/types/config.d.ts
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FrontendLocaleData } from '../../data/translation';
|
|
2
|
+
import type { HassConfig } from 'home-assistant-js-websocket';
|
|
3
|
+
export declare const formatDateWeekdayDay: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
4
|
+
export declare const formatDate: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
5
|
+
export declare const formatDateShort: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
6
|
+
export declare const formatDateNumeric: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
7
|
+
export declare const formatDateVeryShort: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
8
|
+
export declare const formatDateMonthYear: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
9
|
+
export declare const formatDateMonth: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
10
|
+
export declare const formatDateYear: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
11
|
+
export declare const formatDateWeekday: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
12
|
+
export declare const formatDateWeekdayShort: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FrontendLocaleData } from '../../data/translation';
|
|
2
|
+
import type { HassConfig } from 'home-assistant-js-websocket';
|
|
3
|
+
export declare const formatDateTime: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
4
|
+
export declare const formatDateTimeWithBrowserDefaults: (dateObj: Date) => string;
|
|
5
|
+
export declare const formatShortDateTimeWithYear: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
6
|
+
export declare const formatShortDateTime: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
7
|
+
export declare const formatShortDateTimeWithConditionalYear: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
8
|
+
export declare const formatDateTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
9
|
+
export declare const formatDateTimeNumeric: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FrontendLocaleData } from '../../data/translation';
|
|
2
|
+
import type { HassConfig } from 'home-assistant-js-websocket';
|
|
3
|
+
export declare const formatTime: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
4
|
+
export declare const formatTimeWithSeconds: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
5
|
+
export declare const formatTimeWeekday: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
6
|
+
export declare const formatTime24h: (dateObj: Date, locale: FrontendLocaleData, config: HassConfig) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function secondsToDuration(d: number): string | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const computeDomain: (entityId: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type LocalizeFunc = (key: string, ...args: any[]) => string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import type { HomeAssistant } from '../home-assistant';
|
|
1
2
|
export declare enum NumberFormat {
|
|
2
3
|
language = "language",
|
|
3
4
|
system = "system",
|
|
4
5
|
comma_decimal = "comma_decimal",
|
|
5
6
|
decimal_comma = "decimal_comma",
|
|
7
|
+
quote_decimal = "quote_decimal",
|
|
6
8
|
space_comma = "space_comma",
|
|
7
9
|
none = "none"
|
|
8
10
|
}
|
|
@@ -41,3 +43,11 @@ export interface FrontendLocaleData {
|
|
|
41
43
|
first_weekday: FirstWeekday;
|
|
42
44
|
time_zone: TimeZone;
|
|
43
45
|
}
|
|
46
|
+
declare global {
|
|
47
|
+
interface FrontendUserData {
|
|
48
|
+
language: FrontendLocaleData;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
export type TranslationCategory = 'title' | 'state' | 'entity' | 'entity_component' | 'exceptions' | 'config' | 'config_subentries' | 'config_panel' | 'options' | 'device_automation' | 'mfa_setup' | 'system_health' | 'application_credentials' | 'issues' | 'preview_features' | 'selector' | 'services' | 'triggers' | 'conditions';
|
|
52
|
+
export declare const getHassTranslations: (hass: HomeAssistant, language: string, category: TranslationCategory, integration?: string | string[], config_flow?: boolean) => Promise<Record<string, unknown>>;
|
|
53
|
+
export declare const getHassTranslationsPre109: (hass: HomeAssistant, language: string) => Promise<Record<string, unknown>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Auth, Connection, HassConfig, HassEntities, HassEntity, HassServices, HassServiceTarget, MessageBase } from 'home-assistant-js-websocket';
|
|
2
|
-
import { FrontendLocaleData } from './data/
|
|
2
|
+
import { FrontendLocaleData } from './data/translation';
|
|
3
3
|
import { Themes, ThemeSettings } from './data/ws-themes';
|
|
4
4
|
export interface Resources {
|
|
5
5
|
[language: string]: Record<string, string>;
|
|
@@ -13,29 +13,6 @@ export interface Lovelace {
|
|
|
13
13
|
deleteConfig: () => Promise<void>;
|
|
14
14
|
showToast: (params: any) => void;
|
|
15
15
|
}
|
|
16
|
-
export declare function getLovelace(): Lovelace | null;
|
|
17
|
-
export declare function findCardIndex(card: any): Promise<string | null>;
|
|
18
|
-
export type LovelaceCardPath = [number, number] | [number, number, number];
|
|
19
|
-
export type LovelaceContainerPath = [number] | [number, number];
|
|
20
|
-
export declare const parseLovelaceCardPath: (path: LovelaceCardPath) => {
|
|
21
|
-
viewIndex: number;
|
|
22
|
-
sectionIndex?: number;
|
|
23
|
-
cardIndex: number;
|
|
24
|
-
};
|
|
25
|
-
export declare const parseLovelaceContainerPath: (path: LovelaceContainerPath) => {
|
|
26
|
-
viewIndex: number;
|
|
27
|
-
sectionIndex?: number;
|
|
28
|
-
};
|
|
29
|
-
export declare const getLovelaceContainerPath: (path: LovelaceCardPath) => LovelaceContainerPath;
|
|
30
|
-
type FindLovelaceContainer = {
|
|
31
|
-
(config: LovelaceConfig, path: [number]): LovelaceViewRawConfig;
|
|
32
|
-
(config: LovelaceConfig, path: [number, number]): LovelaceSectionRawConfig;
|
|
33
|
-
(config: LovelaceConfig, path: LovelaceContainerPath): LovelaceViewRawConfig | LovelaceSectionRawConfig;
|
|
34
|
-
};
|
|
35
|
-
export declare const findLovelaceContainer: FindLovelaceContainer;
|
|
36
|
-
export declare const findLovelaceCards: (config: LovelaceConfig, path: LovelaceContainerPath) => LovelaceCardConfig[] | undefined;
|
|
37
|
-
export declare const updateLovelaceContainer: (config: LovelaceConfig, path: LovelaceContainerPath, containerConfig: LovelaceViewRawConfig | LovelaceSectionRawConfig) => LovelaceConfig;
|
|
38
|
-
export declare const updateLovelaceCards: (config: LovelaceConfig, path: LovelaceContainerPath, cards: LovelaceCardConfig[]) => LovelaceConfig;
|
|
39
16
|
export interface LovelaceCardEditor extends LovelaceGenericElementEditor {
|
|
40
17
|
setConfig(config: LovelaceCardConfig): void;
|
|
41
18
|
}
|
|
@@ -205,4 +182,15 @@ export declare const fetchResources: (conn: Connection) => Promise<LovelaceResou
|
|
|
205
182
|
export declare const createResource: (hass: HomeAssistant, values: LovelaceResourcesMutableParams) => Promise<LovelaceResource>;
|
|
206
183
|
export declare const updateResource: (hass: HomeAssistant, id: string, updates: Partial<LovelaceResourcesMutableParams>) => Promise<LovelaceResource>;
|
|
207
184
|
export declare const deleteResource: (hass: HomeAssistant, id: string) => Promise<unknown>;
|
|
185
|
+
export interface ConfigChangedEvent {
|
|
186
|
+
config: any;
|
|
187
|
+
}
|
|
188
|
+
declare global {
|
|
189
|
+
interface HASSDomEvents {
|
|
190
|
+
'config-changed': ConfigChangedEvent;
|
|
191
|
+
'hass-more-info': {
|
|
192
|
+
entityId: string | undefined;
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
}
|
|
208
196
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,5 +3,8 @@ export * from './ha-frontend/lovelace/lovelace';
|
|
|
3
3
|
export * from './ha-frontend/fire-event';
|
|
4
4
|
export * from './ha-frontend/data/ws-templates';
|
|
5
5
|
export * from './ha-frontend/data/history';
|
|
6
|
-
export * from './ha-frontend/data/
|
|
6
|
+
export * from './ha-frontend/data/translation';
|
|
7
|
+
export * from './ha-frontend/common/entity/compute_domain';
|
|
8
|
+
export * from './ha-frontend/common/entity/compute_state_domain';
|
|
9
|
+
export * from './ha-frontend/common/translations/localize';
|
|
7
10
|
export * from './config';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type HomeAssistant } from '@types';
|
|
2
2
|
import type { HassEntity } from 'home-assistant-js-websocket';
|
|
3
3
|
export declare const findEntities: (hass: HomeAssistant, maxEntities: number, entities: string[], entitiesFallback: string[], includeDomains?: string[], entityFilter?: (stateObj: HassEntity) => boolean) => any[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "extra-map-card",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "Lovelace custom map card for Home Assistant",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"home-assistant",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "MIT",
|
|
38
38
|
"dependencies": {
|
|
39
|
+
"@formatjs/intl-datetimeformat": "^7.1.0",
|
|
39
40
|
"@maptiler/sdk": "^3.0.1",
|
|
40
41
|
"@mdi/js": "^7.4.47",
|
|
41
|
-
"custom-card-helpers": "^1.9.0",
|
|
42
42
|
"date-fns": "^4.1.0",
|
|
43
43
|
"home-assistant-js-websocket": "^9.4.0",
|
|
44
44
|
"lit": "^3.2.1",
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"@rollup/plugin-json": "^6.1.0",
|
|
54
54
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
55
55
|
"@rollup/plugin-terser": "^0.4.4",
|
|
56
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
56
57
|
"@turf/turf": "^7.2.0",
|
|
57
58
|
"@types/supercluster": "^7.1.3",
|
|
58
59
|
"@typescript-eslint/eslint-plugin": "^8.24.0",
|
|
@@ -71,9 +72,8 @@
|
|
|
71
72
|
"rollup-plugin-postcss": "^4.0.2",
|
|
72
73
|
"rollup-plugin-postcss-lit": "^2.1.0",
|
|
73
74
|
"rollup-plugin-serve": "^1.1.1",
|
|
74
|
-
"rollup-plugin-typescript2": "^0.36.0",
|
|
75
75
|
"tslib": "^2.8.1",
|
|
76
|
-
"typescript": "^5.
|
|
76
|
+
"typescript": "^5.8.3"
|
|
77
77
|
},
|
|
78
78
|
"browser": {
|
|
79
79
|
"crypto": false
|
|
@@ -84,6 +84,8 @@
|
|
|
84
84
|
"lint": "eslint src/**/*.ts --fix",
|
|
85
85
|
"rollup": "rollup -c rollup.config.js --bundleConfigAsCjs",
|
|
86
86
|
"prepare": "husky install",
|
|
87
|
-
"
|
|
87
|
+
"postversion": "npm run build && git add .",
|
|
88
|
+
"clean": "rm -rf dist",
|
|
89
|
+
"start:hass": "docker run --rm -p8123:8123 -v ./test:/config homeassistant/home-assistant:beta"
|
|
88
90
|
}
|
|
89
91
|
}
|