|
1 | | -import { LitElement } from 'lit'; |
2 | | -import '@material/mwc-select'; |
3 | | -import '@material/mwc-list/mwc-list-item'; |
4 | | -export declare class HausgeistCardEditor extends LitElement { |
5 | | - config: { |
6 | | - debug?: boolean; |
7 | | - overrides?: Record<string, Record<string, string>>; |
8 | | - areas?: Array<{ |
9 | | - area_id: string; |
10 | | - name: string; |
11 | | - enabled?: boolean; |
12 | | - }>; |
13 | | - auto?: Record<string, Record<string, string>>; |
14 | | - weather_entity?: string; |
15 | | - default_target?: number; |
16 | | - default_target_entity?: string; |
17 | | - }; |
18 | | - private _hass; |
19 | | - testValues: { |
| 1 | +import { LitElement, TemplateResult, nothing } from 'lit'; |
| 2 | +interface HassEntity { |
| 3 | + entity_id: string; |
| 4 | + state: string; |
| 5 | + attributes: { |
| 6 | + friendly_name?: string; |
| 7 | + area_id?: string; |
| 8 | + device_class?: string; |
| 9 | + device_id?: string; |
20 | 10 | [key: string]: any; |
21 | 11 | }; |
22 | | - rulesJson: string; |
23 | | - notify: boolean; |
24 | | - highThreshold: number; |
| 12 | +} |
| 13 | +interface HassArea { |
| 14 | + area_id: string; |
| 15 | + name?: string; |
| 16 | +} |
| 17 | +interface HassDevice { |
| 18 | + area_id?: string; |
| 19 | +} |
| 20 | +interface HomeAssistant { |
| 21 | + states: Record<string, HassEntity>; |
| 22 | + areas?: Record<string, HassArea>; |
| 23 | + devices?: Record<string, HassDevice>; |
| 24 | +} |
| 25 | +interface AreaConfig { |
| 26 | + area_id: string; |
| 27 | + name: string; |
| 28 | + enabled?: boolean; |
| 29 | +} |
| 30 | +interface HausgeistCardConfig { |
| 31 | + debug?: boolean; |
| 32 | + notify?: boolean; |
| 33 | + highThreshold?: number; |
| 34 | + overrides?: Record<string, Record<string, string>>; |
| 35 | + areas?: AreaConfig[]; |
| 36 | + auto?: Record<string, Record<string, string>>; |
| 37 | + weather_entity?: string; |
| 38 | + default_target?: number; |
| 39 | + default_target_entity?: string; |
| 40 | + rulesJson?: string; |
| 41 | +} |
| 42 | +export declare class HausgeistCardEditor extends LitElement { |
| 43 | + config: HausgeistCardConfig; |
| 44 | + private _areas; |
25 | 45 | private _selectorReady; |
26 | | - private _lastAreas; |
27 | | - private _autodetect; |
28 | | - private _renderWeatherInfo; |
29 | | - setConfig(config: any): void; |
30 | | - get hass(): any; |
31 | | - set hass(hass: any); |
| 46 | + private _hass?; |
| 47 | + static styles: import("lit").CSSResult; |
| 48 | + set hass(value: HomeAssistant | undefined); |
| 49 | + get hass(): HomeAssistant | undefined; |
| 50 | + setConfig(config: HausgeistCardConfig): void; |
32 | 51 | connectedCallback(): void; |
33 | | - _onDebugChange: (e: Event) => void; |
| 52 | + render(): typeof nothing | TemplateResult<1>; |
| 53 | + private _renderGeneralSection; |
| 54 | + private _renderAreasSection; |
| 55 | + private _renderArea; |
| 56 | + private _renderSensorRow; |
| 57 | + private _renderAdvancedSection; |
| 58 | + private _renderMissingSensorsSection; |
| 59 | + private _renderField; |
| 60 | + private _renderSelectorControl; |
| 61 | + private _normalizeSelectorValue; |
| 62 | + private _handleConfigValueChange; |
| 63 | + private _onAreaToggle; |
34 | 64 | private _onAreaSensorChange; |
35 | | - _configChanged(): void; |
36 | | - handleTestValueChange(areaId: string, type: string, e: any): void; |
37 | | - handleRulesChange(e: any): void; |
38 | | - handleNotifyChange(e: any): void; |
39 | | - handleThresholdChange(e: any): void; |
40 | | - private _onAreaEnabledChange; |
41 | | - render(): import("lit-html").TemplateResult<1>; |
42 | | - private _renderEntityPicker; |
43 | | - private _createOptionsForDomains; |
| 65 | + private _emitConfig; |
| 66 | + private _buildAutoMapping; |
| 67 | + private _autodetect; |
| 68 | + private _matchingEntities; |
| 69 | + private _keywordsForType; |
| 70 | + private _domainMatches; |
| 71 | + private _selectorForSensor; |
| 72 | + private _matchesArea; |
| 73 | + private _computeMissingSensors; |
| 74 | + private _syncAreas; |
| 75 | + private _collectAreasFromHass; |
44 | 76 | private _ensureSelectorSystem; |
45 | 77 | } |
| 78 | +export {}; |
0 commit comments