mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Compare commits
20 Commits
security-l
...
feature/ti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0ce17e3dea | ||
|
|
ef9029829a | ||
|
|
8bc53c61f2 | ||
|
|
711dcdbff0 | ||
|
|
6834e458d7 | ||
|
|
d597239925 | ||
|
|
004b3ce025 | ||
|
|
43e7b55e99 | ||
|
|
ea5fe14a64 | ||
|
|
807fbf8bb6 | ||
|
|
44cd425ce8 | ||
|
|
af01f66329 | ||
|
|
d5892b372c | ||
|
|
8656df6129 | ||
|
|
8c543ee67c | ||
|
|
4789d8c793 | ||
|
|
f08bbe7c1e | ||
|
|
9f1ee988bc | ||
|
|
eba0fa35d3 | ||
|
|
5b8c5375b4 |
@@ -68,7 +68,7 @@
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer-top {
|
||||
flex: 1;
|
||||
margin-top: calc( 2 * max(var(--safe-area-inset-top, 0px), 48px) + 46px );
|
||||
margin-top: calc( 2 * max(var(--safe-area-inset-bottom, 0px), 48px) + 46px );
|
||||
padding-top: 48px;
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer-bottom {
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import "../../../src/components/ha-card";
|
||||
import "../../../src/dialogs/more-info/more-info-content";
|
||||
import "../../../src/state-summary/state-card-content";
|
||||
import "../ha-demo-options";
|
||||
import type { HomeAssistant } from "../../../src/types";
|
||||
import { computeShowNewMoreInfo } from "../../../src/dialogs/more-info/const";
|
||||
|
||||
@customElement("demo-more-info")
|
||||
class DemoMoreInfo extends LitElement {
|
||||
@@ -22,13 +21,11 @@ class DemoMoreInfo extends LitElement {
|
||||
<div class="root">
|
||||
<div id="card">
|
||||
<ha-card>
|
||||
${!computeShowNewMoreInfo(state)
|
||||
? html`<state-card-content
|
||||
<state-card-content
|
||||
.stateObj=${state}
|
||||
.hass=${this.hass}
|
||||
in-dialog
|
||||
></state-card-content>`
|
||||
: nothing}
|
||||
></state-card-content>
|
||||
|
||||
<more-info-content
|
||||
.hass=${this.hass}
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
height: auto;
|
||||
padding: 32px 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: min(560px, calc(100vw - var(--safe-area-inset-right, 0px) - var(--safe-area-inset-left, 0px)));
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
padding: 0 16px;
|
||||
box-sizing: content-box;
|
||||
|
||||
16
package.json
16
package.json
@@ -29,13 +29,13 @@
|
||||
"@awesome.me/webawesome": "3.0.0-beta.4",
|
||||
"@babel/runtime": "7.28.3",
|
||||
"@braintree/sanitize-url": "7.1.1",
|
||||
"@codemirror/autocomplete": "6.18.7",
|
||||
"@codemirror/autocomplete": "6.18.6",
|
||||
"@codemirror/commands": "6.8.1",
|
||||
"@codemirror/language": "6.11.3",
|
||||
"@codemirror/legacy-modes": "6.5.1",
|
||||
"@codemirror/search": "6.5.11",
|
||||
"@codemirror/state": "6.5.2",
|
||||
"@codemirror/view": "6.38.2",
|
||||
"@codemirror/view": "6.38.1",
|
||||
"@egjs/hammerjs": "2.0.17",
|
||||
"@formatjs/intl-datetimeformat": "6.18.0",
|
||||
"@formatjs/intl-displaynames": "6.8.11",
|
||||
@@ -159,18 +159,18 @@
|
||||
"@octokit/plugin-retry": "8.0.1",
|
||||
"@octokit/rest": "22.0.0",
|
||||
"@rsdoctor/rspack-plugin": "1.2.3",
|
||||
"@rspack/core": "1.5.2",
|
||||
"@rspack/core": "1.5.1",
|
||||
"@rspack/dev-server": "1.1.4",
|
||||
"@types/babel__plugin-transform-runtime": "7.9.5",
|
||||
"@types/chromecast-caf-receiver": "6.0.24",
|
||||
"@types/chromecast-caf-sender": "1.0.11",
|
||||
"@types/color-name": "2.0.0",
|
||||
"@types/culori": "4.0.1",
|
||||
"@types/culori": "4.0.0",
|
||||
"@types/html-minifier-terser": "7.0.2",
|
||||
"@types/js-yaml": "4.0.9",
|
||||
"@types/leaflet": "1.9.20",
|
||||
"@types/leaflet-draw": "1.0.13",
|
||||
"@types/leaflet.markercluster": "1.5.6",
|
||||
"@types/leaflet-draw": "1.0.12",
|
||||
"@types/leaflet.markercluster": "1.5.5",
|
||||
"@types/lodash.merge": "4.6.9",
|
||||
"@types/luxon": "3.7.1",
|
||||
"@types/mocha": "10.0.10",
|
||||
@@ -204,7 +204,7 @@
|
||||
"husky": "9.1.7",
|
||||
"jsdom": "26.1.0",
|
||||
"jszip": "3.10.1",
|
||||
"lint-staged": "16.1.6",
|
||||
"lint-staged": "16.1.5",
|
||||
"lit-analyzer": "2.0.3",
|
||||
"lodash.merge": "4.6.2",
|
||||
"lodash.template": "4.5.0",
|
||||
@@ -218,7 +218,7 @@
|
||||
"terser-webpack-plugin": "5.3.14",
|
||||
"ts-lit-plugin": "2.0.2",
|
||||
"typescript": "5.9.2",
|
||||
"typescript-eslint": "8.42.0",
|
||||
"typescript-eslint": "8.41.0",
|
||||
"vite-tsconfig-paths": "5.1.4",
|
||||
"vitest": "3.2.4",
|
||||
"webpack-stats-plugin": "1.1.3",
|
||||
|
||||
@@ -67,7 +67,10 @@ export const generateEntityFilter = (
|
||||
}
|
||||
|
||||
if (floors) {
|
||||
if (!floor || !floors.has(floor.floor_id)) {
|
||||
if (!floor) {
|
||||
return false;
|
||||
}
|
||||
if (!floors) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,6 +232,7 @@ export class HaBottomSheet extends LitElement {
|
||||
box-shadow: var(--wa-shadow-l);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
|
||||
top: auto;
|
||||
inset-inline-end: auto;
|
||||
bottom: 0;
|
||||
|
||||
121
src/components/ha-numeric-arrow-input.ts
Normal file
121
src/components/ha-numeric-arrow-input.ts
Normal file
@@ -0,0 +1,121 @@
|
||||
import { css, html, LitElement } from "lit";
|
||||
import { customElement, property, query } from "lit/decorators";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { mdiMinus, mdiPlus } from "@mdi/js";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import type { HaIconButton } from "./ha-icon-button";
|
||||
import "./ha-textfield";
|
||||
import "./ha-icon-button";
|
||||
import { clampValue } from "../data/number";
|
||||
|
||||
@customElement("ha-numeric-arrow-input")
|
||||
export class HaNumericArrowInput extends LitElement {
|
||||
@property({ attribute: false }) public disabled = false;
|
||||
|
||||
@property({ attribute: false }) public required = false;
|
||||
|
||||
@property({ attribute: false }) public min?: number;
|
||||
|
||||
@property({ attribute: false }) public max?: number;
|
||||
|
||||
@property({ attribute: false }) public step?: number;
|
||||
|
||||
@property({ attribute: false }) public padStart?: number;
|
||||
|
||||
@property({ attribute: false }) public labelUp = "Increase";
|
||||
|
||||
@property({ attribute: false }) public labelDown = "Decrease";
|
||||
|
||||
@property({ attribute: false }) public value = 0;
|
||||
|
||||
@query("ha-icon-button[data-direction='up']")
|
||||
private _upButton!: HaIconButton;
|
||||
|
||||
@query("ha-icon-button[data-direction='down']")
|
||||
private _downButton!: HaIconButton;
|
||||
|
||||
private _paddedValue = memoizeOne((value: number, padStart?: number) =>
|
||||
value.toString().padStart(padStart ?? 0, "0")
|
||||
);
|
||||
|
||||
render() {
|
||||
return html`<div
|
||||
class="numeric-arrow-input-container"
|
||||
@keydown=${this._keyDown}
|
||||
>
|
||||
<ha-icon-button
|
||||
data-direction="up"
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.labelUp}
|
||||
.path=${mdiPlus}
|
||||
@click=${this._up}
|
||||
></ha-icon-button>
|
||||
<span class="numeric-arrow-input-value"
|
||||
>${this._paddedValue(this.value, this.padStart)}</span
|
||||
>
|
||||
<ha-icon-button
|
||||
data-direction="down"
|
||||
.disabled=${this.disabled}
|
||||
.label=${this.labelDown}
|
||||
.path=${mdiMinus}
|
||||
@click=${this._down}
|
||||
></ha-icon-button>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
private _keyDown(ev: KeyboardEvent) {
|
||||
if (ev.key === "ArrowUp") {
|
||||
this._upButton.focus();
|
||||
this._up();
|
||||
}
|
||||
if (ev.key === "ArrowDown") {
|
||||
this._downButton.focus();
|
||||
this._down();
|
||||
}
|
||||
}
|
||||
|
||||
private _up() {
|
||||
const newValue = this.value + (this.step ?? 1);
|
||||
fireEvent(
|
||||
this,
|
||||
"value-changed",
|
||||
clampValue({ value: newValue, min: this.min, max: this.max })
|
||||
);
|
||||
}
|
||||
|
||||
private _down() {
|
||||
const newValue = this.value - (this.step ?? 1);
|
||||
fireEvent(
|
||||
this,
|
||||
"value-changed",
|
||||
clampValue({ value: newValue, min: this.min, max: this.max })
|
||||
);
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
.numeric-arrow-input-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.numeric-arrow-input-container ha-icon-button {
|
||||
--mdc-icon-button-size: 24px;
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
|
||||
.numeric-arrow-input-value {
|
||||
color: var(--primary-text-color);
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-numeric-arrow-input": HaNumericArrowInput;
|
||||
}
|
||||
}
|
||||
281
src/components/ha-time-picker.ts
Normal file
281
src/components/ha-time-picker.ts
Normal file
@@ -0,0 +1,281 @@
|
||||
import type { PropertyValues } from "lit";
|
||||
import { css, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { clampValue } from "../data/number";
|
||||
import { useAmPm } from "../common/datetime/use_am_pm";
|
||||
import { fireEvent } from "../common/dom/fire_event";
|
||||
import type { FrontendLocaleData } from "../data/translation";
|
||||
import type { HomeAssistant } from "../types";
|
||||
import type { ClampedValue } from "../data/number";
|
||||
import "./ha-base-time-input";
|
||||
import "./ha-button";
|
||||
import "./ha-numeric-arrow-input";
|
||||
|
||||
@customElement("ha-time-picker")
|
||||
export class HaTimePicker extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ attribute: false }) public locale!: FrontendLocaleData;
|
||||
|
||||
@property({ attribute: false }) public value?: string;
|
||||
|
||||
@property({ attribute: false }) public disabled = false;
|
||||
|
||||
@property({ attribute: false }) public required = false;
|
||||
|
||||
@property({ attribute: false }) public enableSeconds = false;
|
||||
|
||||
@state() private _hours = 0;
|
||||
|
||||
@state() private _minutes = 0;
|
||||
|
||||
@state() private _seconds = 0;
|
||||
|
||||
@state() private _useAmPm = false;
|
||||
|
||||
@state() private _isPm = false;
|
||||
|
||||
protected firstUpdated(changedProperties: PropertyValues) {
|
||||
super.firstUpdated(changedProperties);
|
||||
this._useAmPm = useAmPm(this.locale);
|
||||
|
||||
let hours = NaN;
|
||||
let minutes = NaN;
|
||||
let seconds = NaN;
|
||||
let isPm = false;
|
||||
|
||||
if (this.value) {
|
||||
const parts = this.value?.split(":") || [];
|
||||
minutes = parts[1] ? Number(parts[1]) : 0;
|
||||
seconds = parts[2] ? Number(parts[2]) : 0;
|
||||
const hour24 = parts[0] ? Number(parts[0]) : 0;
|
||||
|
||||
if (this._useAmPm) {
|
||||
if (hour24 === 0) {
|
||||
hours = 12;
|
||||
isPm = false;
|
||||
} else if (hour24 < 12) {
|
||||
hours = hour24;
|
||||
isPm = false;
|
||||
} else if (hour24 === 12) {
|
||||
hours = 12;
|
||||
isPm = true;
|
||||
} else {
|
||||
hours = hour24 - 12;
|
||||
isPm = true;
|
||||
}
|
||||
} else {
|
||||
hours = hour24;
|
||||
}
|
||||
}
|
||||
|
||||
this._hours = hours;
|
||||
this._minutes = minutes;
|
||||
this._seconds = seconds;
|
||||
this._isPm = isPm;
|
||||
}
|
||||
|
||||
protected render() {
|
||||
return html`<div class="time-picker-container">
|
||||
<ha-numeric-arrow-input
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
.min=${this._useAmPm ? 1 : 0}
|
||||
.max=${this._useAmPm ? 12 : 23}
|
||||
.step=${1}
|
||||
.padStart=${2}
|
||||
.value=${this._hours}
|
||||
@value-changed=${this._hoursChanged}
|
||||
.labelUp=${
|
||||
// TODO: Localize
|
||||
"Increase hours"
|
||||
}
|
||||
.labelDown=${
|
||||
// TODO: Localize
|
||||
"Decrease hours"
|
||||
}
|
||||
></ha-numeric-arrow-input>
|
||||
<span class="time-picker-separator">:</span>
|
||||
<ha-numeric-arrow-input
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
.min=${0}
|
||||
.max=${59}
|
||||
.step=${1}
|
||||
.padStart=${2}
|
||||
.labelUp=${
|
||||
// TODO: Localize
|
||||
"Increase minutes"
|
||||
}
|
||||
.labelDown=${
|
||||
// TODO: Localize
|
||||
"Decrease minutes"
|
||||
}
|
||||
.value=${this._minutes}
|
||||
@value-changed=${this._minutesChanged}
|
||||
></ha-numeric-arrow-input>
|
||||
${this.enableSeconds
|
||||
? html`
|
||||
<span class="time-picker-separator">:</span>
|
||||
<ha-numeric-arrow-input
|
||||
.disabled=${this.disabled}
|
||||
.required=${this.required}
|
||||
.min=${0}
|
||||
.max=${59}
|
||||
.step=${1}
|
||||
.padStart=${2}
|
||||
.labelUp=${
|
||||
// TODO: Localize
|
||||
"Increase seconds"
|
||||
}
|
||||
.labelDown=${
|
||||
// TODO: Localize
|
||||
"Decrease seconds"
|
||||
}
|
||||
.value=${this._seconds}
|
||||
@value-changed=${this._secondsChanged}
|
||||
></ha-numeric-arrow-input>
|
||||
`
|
||||
: nothing}
|
||||
${this._useAmPm
|
||||
? html`
|
||||
<ha-button @click=${this._toggleAmPm}>
|
||||
${this._isPm ? "PM" : "AM"}
|
||||
</ha-button>
|
||||
`
|
||||
: nothing}
|
||||
</div>`;
|
||||
}
|
||||
|
||||
protected updated(changedProperties: PropertyValues) {
|
||||
super.updated(changedProperties);
|
||||
|
||||
if (changedProperties.has("_hours")) {
|
||||
this._timeUpdated();
|
||||
}
|
||||
|
||||
if (changedProperties.has("_minutes")) {
|
||||
this._timeUpdated();
|
||||
}
|
||||
|
||||
if (changedProperties.has("_seconds")) {
|
||||
this._timeUpdated();
|
||||
}
|
||||
|
||||
if (changedProperties.has("_useAmPm")) {
|
||||
this._timeUpdated();
|
||||
}
|
||||
|
||||
if (changedProperties.has("_isPm")) {
|
||||
this._timeUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
private _hoursChanged(ev: CustomEvent<ClampedValue>) {
|
||||
ev.stopPropagation?.();
|
||||
this._hours = ev.detail.value;
|
||||
}
|
||||
|
||||
private _minutesChanged(ev: CustomEvent<ClampedValue>) {
|
||||
ev.stopPropagation?.();
|
||||
this._minutes = ev.detail.value;
|
||||
if (ev.detail.clamped) {
|
||||
if (ev.detail.value === 0) {
|
||||
this._hoursChanged({
|
||||
detail: clampValue({
|
||||
value: this._hours - 1,
|
||||
min: this._useAmPm ? 1 : 0,
|
||||
max: this._useAmPm ? 12 : 23,
|
||||
}),
|
||||
} as CustomEvent<ClampedValue>);
|
||||
this._minutes = 59;
|
||||
}
|
||||
|
||||
if (ev.detail.value === 59) {
|
||||
this._hoursChanged({
|
||||
detail: clampValue({
|
||||
value: this._hours + 1,
|
||||
min: this._useAmPm ? 1 : 0,
|
||||
max: this._useAmPm ? 12 : 23,
|
||||
}),
|
||||
} as CustomEvent<ClampedValue>);
|
||||
const hourMax = this._useAmPm ? 12 : 23;
|
||||
if (this._hours < hourMax) {
|
||||
this._minutes = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _secondsChanged(ev: CustomEvent<ClampedValue>) {
|
||||
ev.stopPropagation?.();
|
||||
this._seconds = ev.detail.value;
|
||||
if (ev.detail.clamped) {
|
||||
if (ev.detail.value === 0) {
|
||||
this._minutesChanged({
|
||||
detail: clampValue({ value: this._minutes - 1, min: 0, max: 59 }),
|
||||
} as CustomEvent<ClampedValue>);
|
||||
this._seconds = 59;
|
||||
}
|
||||
|
||||
if (ev.detail.value === 59) {
|
||||
this._minutesChanged({
|
||||
detail: clampValue({ value: this._minutes + 1, min: 0, max: 59 }),
|
||||
} as CustomEvent<ClampedValue>);
|
||||
const hourMax = this._useAmPm ? 12 : 23;
|
||||
if (!(this._hours === hourMax && this._minutes === 59)) {
|
||||
this._seconds = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _toggleAmPm() {
|
||||
this._isPm = !this._isPm;
|
||||
}
|
||||
|
||||
private _timeUpdated() {
|
||||
let hour24 = this._hours;
|
||||
|
||||
if (this._useAmPm) {
|
||||
if (this._hours === 12) {
|
||||
hour24 = this._isPm ? 12 : 0;
|
||||
} else {
|
||||
hour24 = this._isPm ? this._hours + 12 : this._hours;
|
||||
}
|
||||
}
|
||||
|
||||
const timeParts = [
|
||||
hour24.toString().padStart(2, "0"),
|
||||
this._minutes.toString().padStart(2, "0"),
|
||||
this._seconds.toString().padStart(2, "0"),
|
||||
];
|
||||
|
||||
const time = timeParts.join(":");
|
||||
if (time === this.value) {
|
||||
return;
|
||||
}
|
||||
this.value = time;
|
||||
fireEvent(this, "change");
|
||||
fireEvent(this, "value-changed", { value: time });
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
.time-picker-container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.time-picker-separator {
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-time-picker": HaTimePicker;
|
||||
}
|
||||
}
|
||||
@@ -12,3 +12,35 @@ export const getNumberDeviceClassConvertibleUnits = (
|
||||
type: "number/device_class_convertible_units",
|
||||
device_class: deviceClass,
|
||||
});
|
||||
|
||||
export interface ClampedValue {
|
||||
clamped: boolean;
|
||||
value: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clamp a value between a minimum and maximum value
|
||||
* @param value - The value to clamp
|
||||
* @param min - The minimum value
|
||||
* @param max - The maximum value
|
||||
* @returns The clamped value
|
||||
*/
|
||||
export const clampValue = ({
|
||||
value,
|
||||
min,
|
||||
max,
|
||||
}: {
|
||||
value: number;
|
||||
min?: number;
|
||||
max?: number;
|
||||
}): ClampedValue => {
|
||||
if (max !== undefined && value > max) {
|
||||
return { clamped: true, value: max };
|
||||
}
|
||||
|
||||
if (min !== undefined && value < min) {
|
||||
return { clamped: true, value: min };
|
||||
}
|
||||
|
||||
return { clamped: false, value };
|
||||
};
|
||||
|
||||
@@ -11,22 +11,20 @@ import type { HomeAssistant } from "../../types";
|
||||
import { isMac } from "../../util/is_mac";
|
||||
|
||||
interface Text {
|
||||
textTranslationKey: LocalizeKeys;
|
||||
type: "text";
|
||||
key: LocalizeKeys;
|
||||
}
|
||||
|
||||
interface LocalizedShortcut {
|
||||
shortcutTranslationKey: LocalizeKeys;
|
||||
}
|
||||
|
||||
type ShortcutString = string | LocalizedShortcut;
|
||||
type ShortcutString = string | { key: LocalizeKeys };
|
||||
|
||||
interface Shortcut {
|
||||
type: "shortcut";
|
||||
shortcut: ShortcutString[];
|
||||
descriptionTranslationKey: LocalizeKeys;
|
||||
key: LocalizeKeys;
|
||||
}
|
||||
|
||||
interface Section {
|
||||
titleTranslationKey: LocalizeKeys;
|
||||
key: LocalizeKeys;
|
||||
items: (Text | Shortcut)[];
|
||||
}
|
||||
|
||||
@@ -34,115 +32,105 @@ const CTRL_CMD = "__CTRL_CMD__";
|
||||
|
||||
const _SHORTCUTS: Section[] = [
|
||||
{
|
||||
titleTranslationKey: "ui.dialogs.shortcuts.searching.title",
|
||||
key: "ui.dialogs.shortcuts.searching.title",
|
||||
items: [
|
||||
{ type: "text", key: "ui.dialogs.shortcuts.searching.on_any_page" },
|
||||
{
|
||||
textTranslationKey: "ui.dialogs.shortcuts.searching.on_any_page",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: ["C"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.searching.search_command",
|
||||
key: "ui.dialogs.shortcuts.searching.search_command",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: ["E"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.searching.search_entities",
|
||||
key: "ui.dialogs.shortcuts.searching.search_entities",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: ["D"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.searching.search_devices",
|
||||
key: "ui.dialogs.shortcuts.searching.search_devices",
|
||||
},
|
||||
{
|
||||
textTranslationKey:
|
||||
"ui.dialogs.shortcuts.searching.on_pages_with_tables",
|
||||
type: "text",
|
||||
key: "ui.dialogs.shortcuts.searching.on_pages_with_tables",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "F"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.searching.search_in_table",
|
||||
key: "ui.dialogs.shortcuts.searching.search_in_table",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
titleTranslationKey: "ui.dialogs.shortcuts.assist.title",
|
||||
key: "ui.dialogs.shortcuts.assist.title",
|
||||
items: [
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: ["A"],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.assist.open_assist",
|
||||
key: "ui.dialogs.shortcuts.assist.open_assist",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
titleTranslationKey: "ui.dialogs.shortcuts.automation_script.title",
|
||||
key: "ui.dialogs.shortcuts.automation_script.title",
|
||||
items: [
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "C"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.automation_script.copy",
|
||||
key: "ui.dialogs.shortcuts.automation_script.copy",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "X"],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.automation_script.cut",
|
||||
key: "ui.dialogs.shortcuts.automation_script.cut",
|
||||
},
|
||||
{
|
||||
shortcut: [
|
||||
CTRL_CMD,
|
||||
{ shortcutTranslationKey: "ui.dialogs.shortcuts.keys.del" },
|
||||
],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.automation_script.delete",
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "del"],
|
||||
key: "ui.dialogs.shortcuts.automation_script.delete",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "V"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.automation_script.paste",
|
||||
key: "ui.dialogs.shortcuts.automation_script.paste",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, "S"],
|
||||
descriptionTranslationKey:
|
||||
"ui.dialogs.shortcuts.automation_script.save",
|
||||
key: "ui.dialogs.shortcuts.automation_script.save",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
titleTranslationKey: "ui.dialogs.shortcuts.charts.title",
|
||||
key: "ui.dialogs.shortcuts.charts.title",
|
||||
items: [
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [CTRL_CMD, { key: "ui.dialogs.shortcuts.shortcuts.drag" }],
|
||||
key: "ui.dialogs.shortcuts.charts.drag_to_zoom",
|
||||
},
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: [
|
||||
CTRL_CMD,
|
||||
{ shortcutTranslationKey: "ui.dialogs.shortcuts.shortcuts.drag" },
|
||||
{ key: "ui.dialogs.shortcuts.shortcuts.scroll_wheel" },
|
||||
],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.drag_to_zoom",
|
||||
key: "ui.dialogs.shortcuts.charts.scroll_to_zoom",
|
||||
},
|
||||
{
|
||||
shortcut: [
|
||||
CTRL_CMD,
|
||||
{
|
||||
shortcutTranslationKey:
|
||||
"ui.dialogs.shortcuts.shortcuts.scroll_wheel",
|
||||
},
|
||||
],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.scroll_to_zoom",
|
||||
},
|
||||
{
|
||||
shortcut: [
|
||||
{
|
||||
shortcutTranslationKey:
|
||||
"ui.dialogs.shortcuts.shortcuts.double_click",
|
||||
},
|
||||
],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.charts.double_click",
|
||||
type: "shortcut",
|
||||
shortcut: [{ key: "ui.dialogs.shortcuts.shortcuts.double_click" }],
|
||||
key: "ui.dialogs.shortcuts.charts.double_click",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
titleTranslationKey: "ui.dialogs.shortcuts.other.title",
|
||||
key: "ui.dialogs.shortcuts.other.title",
|
||||
items: [
|
||||
{
|
||||
type: "shortcut",
|
||||
shortcut: ["M"],
|
||||
descriptionTranslationKey: "ui.dialogs.shortcuts.other.my_link",
|
||||
key: "ui.dialogs.shortcuts.other.my_link",
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -164,28 +152,28 @@ class DialogShortcuts extends LitElement {
|
||||
}
|
||||
|
||||
private _renderShortcut(
|
||||
shortcutKeys: ShortcutString[],
|
||||
descriptionKey: LocalizeKeys
|
||||
shortcuts: ShortcutString[],
|
||||
translationKey: LocalizeKeys
|
||||
) {
|
||||
const keys = shortcuts.map((shortcut) =>
|
||||
typeof shortcut === "string" ? shortcut : this.hass.localize(shortcut.key)
|
||||
);
|
||||
|
||||
return html`
|
||||
<div class="shortcut">
|
||||
${shortcutKeys.map(
|
||||
(shortcutKey) =>
|
||||
${keys.map(
|
||||
(key) =>
|
||||
html`<span
|
||||
>${shortcutKey === CTRL_CMD
|
||||
>${key === CTRL_CMD
|
||||
? isMac
|
||||
? html`<ha-svg-icon
|
||||
.path=${mdiAppleKeyboardCommand}
|
||||
></ha-svg-icon>`
|
||||
: this.hass.localize("ui.panel.config.automation.editor.ctrl")
|
||||
: typeof shortcutKey === "string"
|
||||
? shortcutKey
|
||||
: this.hass.localize(
|
||||
shortcutKey.shortcutTranslationKey
|
||||
)}</span
|
||||
: key}</span
|
||||
>`
|
||||
)}
|
||||
${this.hass.localize(descriptionKey)}
|
||||
${this.hass.localize(translationKey)}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
@@ -209,18 +197,16 @@ class DialogShortcuts extends LitElement {
|
||||
<div class="content">
|
||||
${_SHORTCUTS.map(
|
||||
(section) => html`
|
||||
<h3>${this.hass.localize(section.titleTranslationKey)}</h3>
|
||||
<h3>${this.hass.localize(section.key)}</h3>
|
||||
<div class="items">
|
||||
${section.items.map((item) => {
|
||||
if ("shortcut" in item) {
|
||||
return this._renderShortcut(
|
||||
(item as Shortcut).shortcut,
|
||||
(item as Shortcut).descriptionTranslationKey
|
||||
);
|
||||
if (item.type === "text") {
|
||||
return html`<p>${this.hass.localize(item.key)}</p>`;
|
||||
}
|
||||
return html`<p>
|
||||
${this.hass.localize((item as Text).textTranslationKey)}
|
||||
</p>`;
|
||||
if (item.type === "shortcut") {
|
||||
return this._renderShortcut(item.shortcut, item.key);
|
||||
}
|
||||
return nothing;
|
||||
})}
|
||||
</div>
|
||||
`
|
||||
|
||||
@@ -79,6 +79,13 @@ export const demoPanels: Panels = {
|
||||
config: null,
|
||||
url_path: "energy",
|
||||
},
|
||||
"time-picker": {
|
||||
component_name: "time-picker",
|
||||
icon: "hass:clock-outline",
|
||||
title: "time_picker",
|
||||
config: null,
|
||||
url_path: "time-picker",
|
||||
},
|
||||
// config: {
|
||||
// component_name: "config",
|
||||
// icon: "hass:cog",
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 32px;
|
||||
padding-top: var(--safe-area-inset-top);
|
||||
}
|
||||
|
||||
.header img {
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer-top {
|
||||
flex: 1;
|
||||
margin-top: calc( 2 * max(var(--safe-area-inset-top, 0px), 48px) + 46px );
|
||||
margin-top: calc( 2 * max(var(--safe-area-inset-bottom, 0px), 48px) + 46px );
|
||||
padding-top: 48px;
|
||||
}
|
||||
#ha-launch-screen .ha-launch-screen-spacer-bottom {
|
||||
|
||||
@@ -19,9 +19,8 @@
|
||||
height: auto;
|
||||
padding: 32px 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
max-width: min(560px, calc(100vw - var(--safe-area-inset-right, 0px) - var(--safe-area-inset-left, 0px)));
|
||||
max-width: 560px;
|
||||
margin: 0 auto;
|
||||
padding: 0 16px;
|
||||
box-sizing: content-box;
|
||||
@@ -33,7 +32,6 @@
|
||||
justify-content: flex-start;
|
||||
margin-bottom: 32px;
|
||||
margin-left: 32px;
|
||||
padding-top: var(--safe-area-inset-top);
|
||||
}
|
||||
|
||||
.header img {
|
||||
|
||||
@@ -146,8 +146,6 @@ export class HomeAssistantMain extends LitElement {
|
||||
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||
--mdc-drawer-width: 56px;
|
||||
--mdc-top-app-bar-width: calc(100% - var(--mdc-drawer-width));
|
||||
--safe-area-content-inset-left: 0px;
|
||||
--safe-area-content-inset-right: var(--safe-area-inset-right);
|
||||
}
|
||||
:host([expanded]) {
|
||||
--mdc-drawer-width: calc(256px + var(--safe-area-inset-left));
|
||||
@@ -155,7 +153,6 @@ export class HomeAssistantMain extends LitElement {
|
||||
:host([modal]) {
|
||||
--mdc-drawer-width: unset;
|
||||
--mdc-top-app-bar-width: unset;
|
||||
--safe-area-content-inset-left: var(--safe-area-inset-left);
|
||||
}
|
||||
partial-panel-resolver,
|
||||
ha-sidebar {
|
||||
|
||||
@@ -30,6 +30,7 @@ const COMPONENTS = {
|
||||
my: () => import("../panels/my/ha-panel-my"),
|
||||
profile: () => import("../panels/profile/ha-panel-profile"),
|
||||
todo: () => import("../panels/todo/ha-panel-todo"),
|
||||
"time-picker": () => import("../panels/time-picker/ha-panel-time-picker"),
|
||||
"media-browser": () =>
|
||||
import("../panels/media-browser/ha-panel-media-browser"),
|
||||
};
|
||||
|
||||
@@ -171,6 +171,7 @@ export default class HaAutomationSidebarCard extends LitElement {
|
||||
transition: box-shadow 180ms ease-in-out;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
z-index: 6;
|
||||
position: relative;
|
||||
background-color: var(
|
||||
--ha-dialog-surface-background,
|
||||
@@ -200,7 +201,6 @@ export default class HaAutomationSidebarCard extends LitElement {
|
||||
.card-content {
|
||||
max-height: calc(100% - 80px);
|
||||
overflow: auto;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 450px) and (min-height: 500px) {
|
||||
|
||||
@@ -65,10 +65,6 @@ export default class HaAutomationSidebarCondition extends LitElement {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Reset testing state when condition changes
|
||||
if (changedProperties.has("sidebarKey")) {
|
||||
this._testing = false;
|
||||
}
|
||||
}
|
||||
|
||||
protected render() {
|
||||
@@ -287,13 +283,11 @@ export default class HaAutomationSidebarCondition extends LitElement {
|
||||
sidebar
|
||||
></ha-automation-condition-editor>`
|
||||
)}
|
||||
<div class="testing-wrapper">
|
||||
<div
|
||||
class="testing ${classMap({
|
||||
active: this._testing,
|
||||
pass: this._testingResult === true,
|
||||
error: this._testingResult === false,
|
||||
narrow: this.narrow,
|
||||
})}"
|
||||
>
|
||||
${this._testingResult
|
||||
@@ -304,7 +298,6 @@ export default class HaAutomationSidebarCondition extends LitElement {
|
||||
"ui.panel.config.automation.editor.conditions.testing_error"
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</ha-automation-sidebar-card>`;
|
||||
}
|
||||
|
||||
@@ -403,13 +396,21 @@ export default class HaAutomationSidebarCondition extends LitElement {
|
||||
ha-automation-sidebar-card {
|
||||
position: relative;
|
||||
}
|
||||
.testing-wrapper {
|
||||
.testing {
|
||||
position: absolute;
|
||||
z-index: 6;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
left: 0px;
|
||||
margin: -1px;
|
||||
text-transform: uppercase;
|
||||
font-size: var(--ha-font-size-m);
|
||||
font-weight: var(--ha-font-weight-bold);
|
||||
background-color: var(--divider-color, #e0e0e0);
|
||||
color: var(--text-primary-color);
|
||||
max-height: 0px;
|
||||
overflow: hidden;
|
||||
transition: max-height 0.3s;
|
||||
text-align: center;
|
||||
border-top-right-radius: var(
|
||||
--ha-card-border-radius,
|
||||
var(--ha-border-radius-lg)
|
||||
@@ -418,33 +419,15 @@ export default class HaAutomationSidebarCondition extends LitElement {
|
||||
--ha-card-border-radius,
|
||||
var(--ha-border-radius-lg)
|
||||
);
|
||||
pointer-events: none;
|
||||
height: 100px;
|
||||
}
|
||||
.testing {
|
||||
--testing-color: var(--divider-color, #e0e0e0);
|
||||
text-transform: uppercase;
|
||||
font-size: var(--ha-font-size-m);
|
||||
font-weight: var(--ha-font-weight-bold);
|
||||
background-color: var(--testing-color);
|
||||
color: var(--text-primary-color);
|
||||
max-height: 0px;
|
||||
transition:
|
||||
max-height 0.3s ease-in-out,
|
||||
padding-top 0.3s ease-in-out;
|
||||
text-align: center;
|
||||
}
|
||||
.testing.active.narrow {
|
||||
padding-top: 16px;
|
||||
}
|
||||
.testing.active {
|
||||
max-height: 100%;
|
||||
max-height: 100px;
|
||||
}
|
||||
.testing.error {
|
||||
--testing-color: var(--accent-color);
|
||||
background-color: var(--accent-color);
|
||||
}
|
||||
.testing.pass {
|
||||
--testing-color: var(--success-color);
|
||||
background-color: var(--success-color);
|
||||
}
|
||||
`,
|
||||
];
|
||||
|
||||
@@ -217,7 +217,7 @@ export const automationRowsStyles = css`
|
||||
export const sidebarEditorStyles = css`
|
||||
.sidebar-editor {
|
||||
display: block;
|
||||
padding-top: 8px;
|
||||
padding-top: 16px;
|
||||
}
|
||||
.description {
|
||||
padding-top: 16px;
|
||||
|
||||
@@ -54,6 +54,10 @@ class DeveloperToolsRouter extends HassRouterPage {
|
||||
tag: "developer-tools-debug",
|
||||
load: () => import("./debug/developer-tools-debug"),
|
||||
},
|
||||
"time-picker": {
|
||||
tag: "developer-tools-time-picker",
|
||||
load: () => import("../time-picker/ha-panel-time-picker"),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -80,6 +80,13 @@ class PanelDeveloperTools extends LitElement {
|
||||
<sl-tab slot="nav" panel="assist" .active=${page === "assist"}
|
||||
>Assist</sl-tab
|
||||
>
|
||||
<sl-tab
|
||||
slot="nav"
|
||||
panel="time-picker"
|
||||
.active=${page === "time-picker"}
|
||||
>
|
||||
Time Picker
|
||||
</sl-tab>
|
||||
</sl-tab-group>
|
||||
</div>
|
||||
<developer-tools-router
|
||||
|
||||
@@ -9,7 +9,7 @@ import { SubscribeMixin } from "../../../mixins/subscribe-mixin";
|
||||
import type { HomeAssistant } from "../../../types";
|
||||
import { coordinatesMinimalResponseCompressedState } from "../common/graph/coordinates";
|
||||
import "../components/hui-graph-base";
|
||||
import type { LovelaceCardFeature, LovelaceCardFeatureEditor } from "../types";
|
||||
import type { LovelaceCardFeature } from "../types";
|
||||
import type {
|
||||
TrendGraphCardFeatureConfig,
|
||||
LovelaceCardFeatureContext,
|
||||
@@ -27,7 +27,7 @@ export const supportsTrendGraphCardFeature = (
|
||||
return domain === "sensor" && isNumericFromAttributes(stateObj.attributes);
|
||||
};
|
||||
|
||||
export const DEFAULT_HOURS_TO_SHOW = 24;
|
||||
const DEFAULT_HOURS_TO_SHOW = 24;
|
||||
|
||||
@customElement("hui-trend-graph-card-feature")
|
||||
class HuiHistoryChartCardFeature
|
||||
@@ -51,13 +51,6 @@ class HuiHistoryChartCardFeature
|
||||
};
|
||||
}
|
||||
|
||||
public static async getConfigElement(): Promise<LovelaceCardFeatureEditor> {
|
||||
await import(
|
||||
"../editor/config-elements/hui-trend-graph-card-feature-editor"
|
||||
);
|
||||
return document.createElement("hui-trend-graph-card-feature-editor");
|
||||
}
|
||||
|
||||
public setConfig(config: TrendGraphCardFeatureConfig): void {
|
||||
if (!config) {
|
||||
throw new Error("Invalid configuration");
|
||||
|
||||
@@ -109,7 +109,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.home"
|
||||
),
|
||||
value: Math.max(0, consumption.total.used_total),
|
||||
color: computedStyle.getPropertyValue("--primary-color").trim(),
|
||||
color: computedStyle.getPropertyValue("--primary-color"),
|
||||
index: 1,
|
||||
};
|
||||
nodes.push(homeNode);
|
||||
@@ -125,9 +125,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.battery"
|
||||
),
|
||||
value: totalBatteryOut,
|
||||
color: computedStyle
|
||||
.getPropertyValue("--energy-battery-out-color")
|
||||
.trim(),
|
||||
color: computedStyle.getPropertyValue("--energy-battery-out-color"),
|
||||
index: 0,
|
||||
});
|
||||
links.push({
|
||||
@@ -143,9 +141,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.battery"
|
||||
),
|
||||
value: totalBatteryIn,
|
||||
color: computedStyle
|
||||
.getPropertyValue("--energy-battery-in-color")
|
||||
.trim(),
|
||||
color: computedStyle.getPropertyValue("--energy-battery-in-color"),
|
||||
index: 1,
|
||||
});
|
||||
if (consumption.total.grid_to_battery > 0) {
|
||||
@@ -173,9 +169,9 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.grid"
|
||||
),
|
||||
value: totalFromGrid,
|
||||
color: computedStyle
|
||||
.getPropertyValue("--energy-grid-consumption-color")
|
||||
.trim(),
|
||||
color: computedStyle.getPropertyValue(
|
||||
"--energy-grid-consumption-color"
|
||||
),
|
||||
index: 0,
|
||||
});
|
||||
|
||||
@@ -196,7 +192,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.solar"
|
||||
),
|
||||
value: totalSolarProduction,
|
||||
color: computedStyle.getPropertyValue("--energy-solar-color").trim(),
|
||||
color: computedStyle.getPropertyValue("--energy-solar-color"),
|
||||
index: 0,
|
||||
});
|
||||
|
||||
@@ -217,9 +213,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_distribution.grid"
|
||||
),
|
||||
value: totalToGrid,
|
||||
color: computedStyle
|
||||
.getPropertyValue("--energy-grid-return-color")
|
||||
.trim(),
|
||||
color: computedStyle.getPropertyValue("--energy-grid-return-color"),
|
||||
index: 1,
|
||||
});
|
||||
if (consumption.total.battery_to_grid > 0) {
|
||||
@@ -301,7 +295,7 @@ class HuiEnergySankeyCard
|
||||
label: this.hass.floors[floorId].name,
|
||||
value: floors[floorId].value,
|
||||
index: 2,
|
||||
color: computedStyle.getPropertyValue("--primary-color").trim(),
|
||||
color: computedStyle.getPropertyValue("--primary-color"),
|
||||
});
|
||||
links.push({
|
||||
source: "home",
|
||||
@@ -322,7 +316,7 @@ class HuiEnergySankeyCard
|
||||
label: this.hass.areas[areaId]!.name,
|
||||
value: areas[areaId].value,
|
||||
index: 3,
|
||||
color: computedStyle.getPropertyValue("--primary-color").trim(),
|
||||
color: computedStyle.getPropertyValue("--primary-color"),
|
||||
});
|
||||
links.push({
|
||||
source: floorNodeId,
|
||||
@@ -366,9 +360,7 @@ class HuiEnergySankeyCard
|
||||
"ui.panel.lovelace.cards.energy.energy_devices_detail_graph.untracked_consumption"
|
||||
),
|
||||
value: untrackedConsumption,
|
||||
color: computedStyle
|
||||
.getPropertyValue("--state-unavailable-color")
|
||||
.trim(),
|
||||
color: computedStyle.getPropertyValue("--state-unavailable-color"),
|
||||
index: 3 + deviceSections.length,
|
||||
});
|
||||
links.push({
|
||||
|
||||
@@ -128,7 +128,6 @@ const EDITABLES_FEATURE_TYPES = new Set<UiFeatureTypes>([
|
||||
"lawn-mower-commands",
|
||||
"numeric-input",
|
||||
"select-options",
|
||||
"trend-graph",
|
||||
"update-actions",
|
||||
"vacuum-commands",
|
||||
"water-heater-operation-modes",
|
||||
|
||||
@@ -1,82 +0,0 @@
|
||||
import { html, LitElement, nothing } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||
import "../../../../components/ha-form/ha-form";
|
||||
import type {
|
||||
HaFormSchema,
|
||||
SchemaUnion,
|
||||
} from "../../../../components/ha-form/types";
|
||||
import type { HomeAssistant } from "../../../../types";
|
||||
import { DEFAULT_HOURS_TO_SHOW } from "../../card-features/hui-trend-graph-card-feature";
|
||||
import type {
|
||||
LovelaceCardFeatureContext,
|
||||
TrendGraphCardFeatureConfig,
|
||||
} from "../../card-features/types";
|
||||
import type { LovelaceCardFeatureEditor } from "../../types";
|
||||
|
||||
const SCHEMA = [
|
||||
{
|
||||
name: "hours_to_show",
|
||||
default: DEFAULT_HOURS_TO_SHOW,
|
||||
selector: { number: { min: 1, mode: "box" } },
|
||||
},
|
||||
] as const satisfies HaFormSchema[];
|
||||
|
||||
@customElement("hui-trend-graph-card-feature-editor")
|
||||
export class HuiTrendGraphCardFeatureEditor
|
||||
extends LitElement
|
||||
implements LovelaceCardFeatureEditor
|
||||
{
|
||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||
|
||||
@property({ attribute: false }) public context?: LovelaceCardFeatureContext;
|
||||
|
||||
@state() private _config?: TrendGraphCardFeatureConfig;
|
||||
|
||||
public setConfig(config: TrendGraphCardFeatureConfig): void {
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
protected render() {
|
||||
if (!this.hass || !this._config) {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
const data = { ...this._config };
|
||||
|
||||
if (!this._config.hours_to_show) {
|
||||
data.hours_to_show = DEFAULT_HOURS_TO_SHOW;
|
||||
}
|
||||
|
||||
return html`
|
||||
<ha-form
|
||||
.hass=${this.hass}
|
||||
.data=${data}
|
||||
.schema=${SCHEMA}
|
||||
.computeLabel=${this._computeLabelCallback}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-form>
|
||||
`;
|
||||
}
|
||||
|
||||
private _valueChanged(ev: CustomEvent): void {
|
||||
fireEvent(this, "config-changed", { config: ev.detail.value });
|
||||
}
|
||||
|
||||
private _computeLabelCallback = (schema: SchemaUnion<typeof SCHEMA>) => {
|
||||
switch (schema.name) {
|
||||
case "hours_to_show":
|
||||
return this.hass!.localize(
|
||||
`ui.panel.lovelace.editor.card.generic.${schema.name}`
|
||||
);
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"hui-trend-graph-card-feature-editor": HuiTrendGraphCardFeatureEditor;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
} from "../areas/helpers/areas-strategy-helper";
|
||||
import { getHomeStructure } from "./helpers/home-structure";
|
||||
import { findEntities, HOME_SUMMARIES_FILTERS } from "./helpers/home-summaries";
|
||||
import type { LogbookCardConfig } from "../../cards/types";
|
||||
|
||||
export interface HomeSecurityViewStrategyConfig {
|
||||
type: "home-security";
|
||||
@@ -132,24 +131,6 @@ export class HomeSecurityViewStrategy extends ReactiveElement {
|
||||
}
|
||||
}
|
||||
|
||||
sections.push({
|
||||
type: "grid",
|
||||
cards: [
|
||||
{
|
||||
type: "heading",
|
||||
heading: hass.localize("panel.logbook"),
|
||||
tap_action: {
|
||||
action: "navigate",
|
||||
navigation_path: `/logbook?entity_id=${entities.join(",")}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
type: "logbook",
|
||||
target: { entity_id: entities },
|
||||
} satisfies LogbookCardConfig,
|
||||
],
|
||||
});
|
||||
|
||||
return {
|
||||
type: "sections",
|
||||
max_columns: 2,
|
||||
|
||||
180
src/panels/time-picker/ha-panel-time-picker.ts
Normal file
180
src/panels/time-picker/ha-panel-time-picker.ts
Normal file
@@ -0,0 +1,180 @@
|
||||
import { html, LitElement, css } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
import "../../components/ha-time-picker";
|
||||
import "../../components/ha-card";
|
||||
import "../../components/ha-button";
|
||||
import "../../components/ha-alert";
|
||||
import "../../components/ha-selector/ha-selector";
|
||||
|
||||
@customElement("developer-tools-time-picker")
|
||||
export class DeveloperToolsTimePicker extends LitElement {
|
||||
@property({ attribute: false })
|
||||
public hass!: HomeAssistant;
|
||||
|
||||
@property({ type: Boolean, reflect: true })
|
||||
public narrow = false;
|
||||
|
||||
@state()
|
||||
private _timeValue = "14:15:00";
|
||||
|
||||
@state()
|
||||
private _timeValue2 = "09:05:05";
|
||||
|
||||
static get styles() {
|
||||
return css`
|
||||
:host {
|
||||
display: block;
|
||||
padding: 16px;
|
||||
max-width: 800px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.header h1 {
|
||||
margin: 0 0 8px 0;
|
||||
color: var(--primary-text-color);
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.header p {
|
||||
margin: 0;
|
||||
color: var(--secondary-text-color);
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.section h2 {
|
||||
margin: 0 0 16px 0;
|
||||
color: var(--primary-text-color);
|
||||
font-size: 20px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.example {
|
||||
background: var(--card-background-color);
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid var(--divider-color);
|
||||
}
|
||||
|
||||
.example h3 {
|
||||
margin: 0 0 16px 0;
|
||||
color: var(--primary-text-color);
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.time-picker-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.value-display {
|
||||
background: var(--secondary-background-color);
|
||||
padding: 8px 12px;
|
||||
border-radius: 6px;
|
||||
font-family: monospace;
|
||||
font-size: 14px;
|
||||
color: var(--primary-text-color);
|
||||
min-width: 100px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.form-toggle {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
@media (max-width: 600px) {
|
||||
:host {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.time-picker-container {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.controls {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
protected render() {
|
||||
return html`
|
||||
<div class="header">
|
||||
<h1>Time picker demo</h1>
|
||||
<p>
|
||||
This page demonstrates the ha-time-picker component with various
|
||||
configurations and use cases.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Time picker</h2>
|
||||
<div class="example">
|
||||
<div class="time-picker-container">
|
||||
<ha-time-picker
|
||||
.locale=${this.hass.locale}
|
||||
.value=${this._timeValue}
|
||||
@value-changed=${this._onTimeChanged}
|
||||
></ha-time-picker>
|
||||
<div class="value-display">${this._timeValue}</div>
|
||||
</div>
|
||||
<p>Current value: ${this._timeValue}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section">
|
||||
<h2>Time picker with seconds</h2>
|
||||
<div class="example">
|
||||
<div class="time-picker-container">
|
||||
<ha-time-picker
|
||||
.locale=${this.hass.locale}
|
||||
.value=${this._timeValue2}
|
||||
.enableSeconds=${true}
|
||||
@value-changed=${this._onTime2Changed}
|
||||
></ha-time-picker>
|
||||
<div class="value-display">${this._timeValue2}</div>
|
||||
</div>
|
||||
<p>Current value: ${this._timeValue2}</p>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
|
||||
private _onTimeChanged(ev: CustomEvent) {
|
||||
this._timeValue = ev.detail.value;
|
||||
}
|
||||
|
||||
private _onTime2Changed(ev: CustomEvent) {
|
||||
this._timeValue2 = ev.detail.value;
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"developer-tools-time-picker": DeveloperToolsTimePicker;
|
||||
}
|
||||
}
|
||||
@@ -1383,6 +1383,7 @@
|
||||
"related": "Related",
|
||||
"history": "History",
|
||||
"logbook": "Logbook",
|
||||
"device_info": "Device info",
|
||||
"device_or_service_info": "[%key:ui::panel::config::devices::device_info%]",
|
||||
"device_type": {
|
||||
"device": "[%key:ui::panel::config::devices::type::device_heading%]",
|
||||
@@ -2039,9 +2040,6 @@
|
||||
"title": "Shortcuts",
|
||||
"enable_shortcuts_hint": "For keyboard shortcuts to work, make sure you have them enabled in your {user_profile}.",
|
||||
"enable_shortcuts_hint_user_profile": "user profile",
|
||||
"keys": {
|
||||
"del": "Del"
|
||||
},
|
||||
"shortcuts": {
|
||||
"double_click": "Double-click",
|
||||
"scroll_wheel": "Scroll",
|
||||
|
||||
@@ -1,124 +0,0 @@
|
||||
import type { HassEntity } from "home-assistant-js-websocket";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { deviceTrackerIcon } from "../../../src/common/entity/device_tracker_icon";
|
||||
|
||||
describe("deviceTrackerIcon", () => {
|
||||
const createMockStateObj = (
|
||||
source_type: string,
|
||||
state = "home"
|
||||
): HassEntity => ({
|
||||
entity_id: "device_tracker.test",
|
||||
state,
|
||||
attributes: { source_type },
|
||||
context: { id: "test", parent_id: null, user_id: null },
|
||||
last_changed: "2023-01-01T00:00:00Z",
|
||||
last_updated: "2023-01-01T00:00:00Z",
|
||||
});
|
||||
|
||||
describe("router source type", () => {
|
||||
it("should return lan-connect icon when home", () => {
|
||||
const stateObj = createMockStateObj("router", "home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:lan-connect");
|
||||
});
|
||||
|
||||
it("should return lan-disconnect icon when not home", () => {
|
||||
const stateObj = createMockStateObj("router", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:lan-disconnect");
|
||||
});
|
||||
|
||||
it("should return lan-disconnect icon for any other state", () => {
|
||||
const stateObj = createMockStateObj("router", "office");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:lan-disconnect");
|
||||
});
|
||||
|
||||
it("should use explicit state parameter over state object state", () => {
|
||||
const stateObj = createMockStateObj("router", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj, "home")).toBe("mdi:lan-connect");
|
||||
});
|
||||
});
|
||||
|
||||
describe("bluetooth source type", () => {
|
||||
it("should return bluetooth-connect icon when home for bluetooth", () => {
|
||||
const stateObj = createMockStateObj("bluetooth", "home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:bluetooth-connect");
|
||||
});
|
||||
|
||||
it("should return bluetooth icon when not home for bluetooth", () => {
|
||||
const stateObj = createMockStateObj("bluetooth", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:bluetooth");
|
||||
});
|
||||
|
||||
it("should return bluetooth-connect icon when home for bluetooth_le", () => {
|
||||
const stateObj = createMockStateObj("bluetooth_le", "home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:bluetooth-connect");
|
||||
});
|
||||
|
||||
it("should return bluetooth icon when not home for bluetooth_le", () => {
|
||||
const stateObj = createMockStateObj("bluetooth_le", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:bluetooth");
|
||||
});
|
||||
|
||||
it("should use explicit state parameter for bluetooth", () => {
|
||||
const stateObj = createMockStateObj("bluetooth", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj, "home")).toBe("mdi:bluetooth-connect");
|
||||
});
|
||||
});
|
||||
|
||||
describe("other source types", () => {
|
||||
it("should return account icon when home for gps", () => {
|
||||
const stateObj = createMockStateObj("gps", "home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account");
|
||||
});
|
||||
|
||||
it("should return account-arrow-right icon when not home for gps", () => {
|
||||
const stateObj = createMockStateObj("gps", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account-arrow-right");
|
||||
});
|
||||
|
||||
it("should return account icon for unknown location with gps", () => {
|
||||
const stateObj = createMockStateObj("gps", "office");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account");
|
||||
});
|
||||
|
||||
it("should handle unknown source type", () => {
|
||||
const stateObj = createMockStateObj("unknown", "home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account");
|
||||
});
|
||||
|
||||
it("should handle unknown source type when not home", () => {
|
||||
const stateObj = createMockStateObj("unknown", "not_home");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account-arrow-right");
|
||||
});
|
||||
});
|
||||
|
||||
describe("edge cases", () => {
|
||||
it("should handle missing source_type attribute", () => {
|
||||
const stateObj: HassEntity = {
|
||||
entity_id: "device_tracker.test",
|
||||
state: "home",
|
||||
attributes: {},
|
||||
context: { id: "test", parent_id: null, user_id: null },
|
||||
last_changed: "2023-01-01T00:00:00Z",
|
||||
last_updated: "2023-01-01T00:00:00Z",
|
||||
};
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account");
|
||||
});
|
||||
|
||||
it("should handle undefined state object attributes", () => {
|
||||
const stateObj: HassEntity = {
|
||||
entity_id: "device_tracker.test",
|
||||
state: "not_home",
|
||||
attributes: {},
|
||||
context: { id: "test", parent_id: null, user_id: null },
|
||||
last_changed: "2023-01-01T00:00:00Z",
|
||||
last_updated: "2023-01-01T00:00:00Z",
|
||||
};
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:account-arrow-right");
|
||||
});
|
||||
|
||||
it("should handle empty string state", () => {
|
||||
const stateObj = createMockStateObj("router", "");
|
||||
expect(deviceTrackerIcon(stateObj)).toBe("mdi:lan-disconnect");
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,391 +0,0 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { generateEntityFilter } from "../../../src/common/entity/entity_filter";
|
||||
import type { HomeAssistant } from "../../../src/types";
|
||||
|
||||
// Mock HomeAssistant with comprehensive data
|
||||
const mockHass: HomeAssistant = {
|
||||
states: {
|
||||
"light.living_room": {
|
||||
entity_id: "light.living_room",
|
||||
state: "on",
|
||||
attributes: { device_class: "light" },
|
||||
},
|
||||
"switch.kitchen": {
|
||||
entity_id: "switch.kitchen",
|
||||
state: "off",
|
||||
attributes: { device_class: "switch" },
|
||||
},
|
||||
"sensor.temperature": {
|
||||
entity_id: "sensor.temperature",
|
||||
state: "22.5",
|
||||
attributes: { device_class: "temperature" },
|
||||
},
|
||||
"binary_sensor.motion": {
|
||||
entity_id: "binary_sensor.motion",
|
||||
state: "off",
|
||||
attributes: { device_class: "motion" },
|
||||
},
|
||||
"climate.thermostat": {
|
||||
entity_id: "climate.thermostat",
|
||||
state: "heat",
|
||||
attributes: {},
|
||||
},
|
||||
"media_player.tv": {
|
||||
entity_id: "media_player.tv",
|
||||
state: "off",
|
||||
attributes: {},
|
||||
},
|
||||
"light.bedroom": {
|
||||
entity_id: "light.bedroom",
|
||||
state: "off",
|
||||
attributes: { device_class: "light" },
|
||||
},
|
||||
"switch.basement": {
|
||||
entity_id: "switch.basement",
|
||||
state: "on",
|
||||
attributes: { device_class: "switch" },
|
||||
},
|
||||
"sensor.humidity": {
|
||||
entity_id: "sensor.humidity",
|
||||
state: "45",
|
||||
attributes: { device_class: "humidity", entity_category: "diagnostic" },
|
||||
},
|
||||
"light.no_area": {
|
||||
entity_id: "light.no_area",
|
||||
state: "off",
|
||||
attributes: { device_class: "light" },
|
||||
},
|
||||
} as any,
|
||||
entities: {
|
||||
"light.living_room": {
|
||||
entity_id: "light.living_room",
|
||||
device_id: "device1",
|
||||
area_id: "living_room",
|
||||
labels: [],
|
||||
},
|
||||
"switch.kitchen": {
|
||||
entity_id: "switch.kitchen",
|
||||
device_id: "device2",
|
||||
area_id: "kitchen",
|
||||
labels: [],
|
||||
},
|
||||
"sensor.temperature": {
|
||||
entity_id: "sensor.temperature",
|
||||
device_id: "device3",
|
||||
area_id: "living_room",
|
||||
labels: [],
|
||||
},
|
||||
"binary_sensor.motion": {
|
||||
entity_id: "binary_sensor.motion",
|
||||
device_id: "device4",
|
||||
area_id: "hallway",
|
||||
labels: [],
|
||||
},
|
||||
"climate.thermostat": {
|
||||
entity_id: "climate.thermostat",
|
||||
device_id: "device5",
|
||||
area_id: "living_room",
|
||||
labels: [],
|
||||
},
|
||||
"media_player.tv": {
|
||||
entity_id: "media_player.tv",
|
||||
device_id: "device6",
|
||||
area_id: "living_room",
|
||||
labels: [],
|
||||
},
|
||||
"light.bedroom": {
|
||||
entity_id: "light.bedroom",
|
||||
device_id: "device7",
|
||||
area_id: "bedroom",
|
||||
labels: [],
|
||||
},
|
||||
"switch.basement": {
|
||||
entity_id: "switch.basement",
|
||||
device_id: "device8",
|
||||
area_id: "basement",
|
||||
labels: [],
|
||||
},
|
||||
"sensor.humidity": {
|
||||
entity_id: "sensor.humidity",
|
||||
device_id: "device9",
|
||||
area_id: "living_room",
|
||||
entity_category: "diagnostic",
|
||||
labels: ["climate", "monitoring"],
|
||||
},
|
||||
"light.no_area": {
|
||||
entity_id: "light.no_area",
|
||||
device_id: "device10",
|
||||
labels: [],
|
||||
},
|
||||
} as any,
|
||||
devices: {
|
||||
device1: { id: "device1", area_id: "living_room" },
|
||||
device2: { id: "device2", area_id: "kitchen" },
|
||||
device3: { id: "device3", area_id: "living_room" },
|
||||
device4: { id: "device4", area_id: "hallway" },
|
||||
device5: { id: "device5", area_id: "living_room" },
|
||||
device6: { id: "device6", area_id: "living_room" },
|
||||
device7: { id: "device7", area_id: "bedroom" },
|
||||
device8: { id: "device8", area_id: "basement" },
|
||||
device9: { id: "device9", area_id: "living_room" },
|
||||
device10: { id: "device10" }, // no area_id
|
||||
} as any,
|
||||
areas: {
|
||||
living_room: {
|
||||
area_id: "living_room",
|
||||
name: "Living Room",
|
||||
floor_id: "main_floor",
|
||||
},
|
||||
kitchen: { area_id: "kitchen", name: "Kitchen", floor_id: "main_floor" },
|
||||
bedroom: { area_id: "bedroom", name: "Bedroom", floor_id: "upper_floor" },
|
||||
basement: {
|
||||
area_id: "basement",
|
||||
name: "Basement",
|
||||
floor_id: "basement_floor",
|
||||
},
|
||||
hallway: { area_id: "hallway", name: "Hallway", floor_id: "main_floor" },
|
||||
} as any,
|
||||
floors: {
|
||||
main_floor: { floor_id: "main_floor", name: "Main Floor" },
|
||||
upper_floor: { floor_id: "upper_floor", name: "Upper Floor" },
|
||||
basement_floor: { floor_id: "basement_floor", name: "Basement Floor" },
|
||||
} as any,
|
||||
} as HomeAssistant;
|
||||
|
||||
describe("generateEntityFilter", () => {
|
||||
describe("domain filtering", () => {
|
||||
it("should filter entities by single domain", () => {
|
||||
const filter = generateEntityFilter(mockHass, { domain: "light" });
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities by multiple domains", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
domain: ["light", "switch"],
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(true);
|
||||
// Non-existent entities return false
|
||||
expect(filter("switch.fan")).toBe(false);
|
||||
expect(filter("sensor.temperature")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle domain as string vs array", () => {
|
||||
const singleFilter = generateEntityFilter(mockHass, { domain: "sensor" });
|
||||
const arrayFilter = generateEntityFilter(mockHass, {
|
||||
domain: ["sensor"],
|
||||
});
|
||||
|
||||
expect(singleFilter("sensor.temperature")).toBe(true);
|
||||
expect(arrayFilter("sensor.temperature")).toBe(true);
|
||||
expect(singleFilter("light.living_room")).toBe(false);
|
||||
expect(arrayFilter("light.living_room")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("device class filtering", () => {
|
||||
it("should filter entities by single device class", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
device_class: "temperature",
|
||||
});
|
||||
|
||||
expect(filter("sensor.temperature")).toBe(true);
|
||||
expect(filter("sensor.humidity")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities by multiple device classes", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
device_class: ["temperature", "humidity"],
|
||||
});
|
||||
|
||||
expect(filter("sensor.temperature")).toBe(true);
|
||||
expect(filter("sensor.humidity")).toBe(true);
|
||||
expect(filter("light.living_room")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle entities without device class", () => {
|
||||
const filter = generateEntityFilter(mockHass, { device_class: "test" });
|
||||
|
||||
expect(filter("climate.thermostat")).toBe(false);
|
||||
expect(filter("media_player.tv")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("area filtering", () => {
|
||||
it("should filter entities by single area", () => {
|
||||
const filter = generateEntityFilter(mockHass, { area: "living_room" });
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("sensor.temperature")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities by multiple areas", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
area: ["living_room", "kitchen"],
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(true);
|
||||
expect(filter("light.bedroom")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("floor filtering", () => {
|
||||
// NOTE: The current implementation has a bug where it checks `if (!floors)` instead of `if (!floors.has(floor.floor_id))`
|
||||
// So floor filtering will never actually filter by floor - it only checks if the entity has a floor at all
|
||||
it("should filter entities by floor (tests current buggy behavior)", () => {
|
||||
const filter = generateEntityFilter(mockHass, { floor: "main_floor" });
|
||||
|
||||
// Due to bug, all entities with floors pass (not just main_floor)
|
||||
expect(filter("light.living_room")).toBe(true); // has floor
|
||||
expect(filter("switch.kitchen")).toBe(true); // has floor
|
||||
expect(filter("binary_sensor.motion")).toBe(true); // has floor
|
||||
expect(filter("light.bedroom")).toBe(false); // wrong floor
|
||||
expect(filter("switch.basement")).toBe(false); // wrong floor
|
||||
|
||||
// Entities without floors should fail
|
||||
expect(filter("light.no_area")).toBe(false); // no area = no floor
|
||||
});
|
||||
|
||||
it("should handle multiple floors (tests current buggy behavior)", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
floor: ["main_floor", "upper_floor"],
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("light.bedroom")).toBe(true);
|
||||
expect(filter("switch.basement")).toBe(false);
|
||||
|
||||
// Entities without floors should fail
|
||||
expect(filter("light.no_area")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("device filtering", () => {
|
||||
it("should filter entities by single device", () => {
|
||||
const filter = generateEntityFilter(mockHass, { device: "device1" });
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities by multiple devices", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
device: ["device1", "device2"],
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(true);
|
||||
expect(filter("sensor.temperature")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("entity category filtering", () => {
|
||||
it("should filter entities by entity category", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
entity_category: "diagnostic",
|
||||
});
|
||||
|
||||
expect(filter("sensor.humidity")).toBe(true);
|
||||
expect(filter("sensor.temperature")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities with no entity category", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
entity_category: "none",
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("sensor.humidity")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("label filtering", () => {
|
||||
it("should filter entities by single label", () => {
|
||||
const filter = generateEntityFilter(mockHass, { label: "climate" });
|
||||
|
||||
expect(filter("sensor.humidity")).toBe(true);
|
||||
expect(filter("sensor.temperature")).toBe(false);
|
||||
});
|
||||
|
||||
it("should filter entities by multiple labels", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
label: ["climate", "monitoring"],
|
||||
});
|
||||
|
||||
expect(filter("sensor.humidity")).toBe(true);
|
||||
expect(filter("light.living_room")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("combined filtering", () => {
|
||||
it("should combine multiple filter criteria with AND logic", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
domain: "light",
|
||||
area: "living_room",
|
||||
});
|
||||
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("light.bedroom")).toBe(false);
|
||||
expect(filter("sensor.temperature")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle complex combinations", () => {
|
||||
const filter = generateEntityFilter(mockHass, {
|
||||
domain: ["sensor", "light"],
|
||||
area: "living_room",
|
||||
device_class: ["temperature", "light"],
|
||||
});
|
||||
|
||||
expect(filter("sensor.temperature")).toBe(true);
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("sensor.humidity")).toBe(false); // wrong device class
|
||||
expect(filter("light.bedroom")).toBe(false); // wrong area
|
||||
});
|
||||
});
|
||||
|
||||
describe("empty filter criteria", () => {
|
||||
it("should handle empty filter criteria", () => {
|
||||
const filter = generateEntityFilter(mockHass, {});
|
||||
|
||||
// Empty filter should pass all entities that exist in hass.states
|
||||
expect(filter("light.living_room")).toBe(true);
|
||||
expect(filter("switch.kitchen")).toBe(true);
|
||||
expect(filter("nonexistent.entity")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle empty domain array", () => {
|
||||
const filter = generateEntityFilter(mockHass, { domain: [] });
|
||||
|
||||
// Empty domain array means no entities should pass domain filter
|
||||
expect(filter("light.living_room")).toBe(false);
|
||||
expect(filter("switch.kitchen")).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("edge cases", () => {
|
||||
it("should handle non-existent entities", () => {
|
||||
const filter = generateEntityFilter(mockHass, { domain: "light" });
|
||||
|
||||
expect(filter("light.nonexistent")).toBe(false);
|
||||
expect(filter("invalid_entity_id")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle entities without device or area assignments", () => {
|
||||
const filter = generateEntityFilter(mockHass, { area: "living_room" });
|
||||
|
||||
expect(filter("light.no_area")).toBe(false);
|
||||
});
|
||||
|
||||
it("should handle entities with device but no area", () => {
|
||||
const filter = generateEntityFilter(mockHass, { area: "living_room" });
|
||||
|
||||
// light.no_area has device10 which has no area_id
|
||||
expect(filter("light.no_area")).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
326
yarn.lock
326
yarn.lock
@@ -1216,15 +1216,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@codemirror/autocomplete@npm:6.18.7":
|
||||
version: 6.18.7
|
||||
resolution: "@codemirror/autocomplete@npm:6.18.7"
|
||||
"@codemirror/autocomplete@npm:6.18.6":
|
||||
version: 6.18.6
|
||||
resolution: "@codemirror/autocomplete@npm:6.18.6"
|
||||
dependencies:
|
||||
"@codemirror/language": "npm:^6.0.0"
|
||||
"@codemirror/state": "npm:^6.0.0"
|
||||
"@codemirror/view": "npm:^6.17.0"
|
||||
"@lezer/common": "npm:^1.0.0"
|
||||
checksum: 10/e50e3345d7d33e762d9abd2e6b1ea4ff54afe1630310464a5ddb42cab52fd5bac783ec0dc8a328cb746be6a7f9f711b6fcd8ef311af123511e8307b4c056cb9d
|
||||
checksum: 10/0574d96fd04ccf2d3b7ae3c4efe0a72f423fa81658876ec50865ce3371cea038aeddf026976ec0d0ccbee72ac66bdf7deec9106dee251ad49019ae7e1a871663
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1283,15 +1283,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@codemirror/view@npm:6.38.2, @codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0":
|
||||
version: 6.38.2
|
||||
resolution: "@codemirror/view@npm:6.38.2"
|
||||
"@codemirror/view@npm:6.38.1, @codemirror/view@npm:^6.0.0, @codemirror/view@npm:^6.17.0, @codemirror/view@npm:^6.23.0, @codemirror/view@npm:^6.27.0":
|
||||
version: 6.38.1
|
||||
resolution: "@codemirror/view@npm:6.38.1"
|
||||
dependencies:
|
||||
"@codemirror/state": "npm:^6.5.0"
|
||||
crelt: "npm:^1.0.6"
|
||||
style-mod: "npm:^4.1.0"
|
||||
w3c-keyname: "npm:^2.2.4"
|
||||
checksum: 10/300608850a29215d7b47fe8ade183fc2241457a924335bd127e29e1af11da9314369c65ec0da968177086f3529abbcd71a609c1af673ea8951c32a523cab358c
|
||||
checksum: 10/e0c5a365608749dd096ba7a930c8393f316bf4c2cacd1465a47a057d0a9f9868ff372a0bb6eb696c926f88411139f79a97a05f8c884bcc380145445cc61e68c8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -3990,92 +3990,92 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-darwin-arm64@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-darwin-arm64@npm:1.5.2"
|
||||
"@rspack/binding-darwin-arm64@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-darwin-arm64@npm:1.5.1"
|
||||
conditions: os=darwin & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-darwin-x64@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-darwin-x64@npm:1.5.2"
|
||||
"@rspack/binding-darwin-x64@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-darwin-x64@npm:1.5.1"
|
||||
conditions: os=darwin & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-linux-arm64-gnu@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-linux-arm64-gnu@npm:1.5.2"
|
||||
"@rspack/binding-linux-arm64-gnu@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-linux-arm64-gnu@npm:1.5.1"
|
||||
conditions: os=linux & cpu=arm64 & libc=glibc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-linux-arm64-musl@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-linux-arm64-musl@npm:1.5.2"
|
||||
"@rspack/binding-linux-arm64-musl@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-linux-arm64-musl@npm:1.5.1"
|
||||
conditions: os=linux & cpu=arm64 & libc=musl
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-linux-x64-gnu@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-linux-x64-gnu@npm:1.5.2"
|
||||
"@rspack/binding-linux-x64-gnu@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-linux-x64-gnu@npm:1.5.1"
|
||||
conditions: os=linux & cpu=x64 & libc=glibc
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-linux-x64-musl@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-linux-x64-musl@npm:1.5.2"
|
||||
"@rspack/binding-linux-x64-musl@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-linux-x64-musl@npm:1.5.1"
|
||||
conditions: os=linux & cpu=x64 & libc=musl
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-wasm32-wasi@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-wasm32-wasi@npm:1.5.2"
|
||||
"@rspack/binding-wasm32-wasi@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-wasm32-wasi@npm:1.5.1"
|
||||
dependencies:
|
||||
"@napi-rs/wasm-runtime": "npm:^1.0.1"
|
||||
conditions: cpu=wasm32
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-win32-arm64-msvc@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-win32-arm64-msvc@npm:1.5.2"
|
||||
"@rspack/binding-win32-arm64-msvc@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-win32-arm64-msvc@npm:1.5.1"
|
||||
conditions: os=win32 & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-win32-ia32-msvc@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-win32-ia32-msvc@npm:1.5.2"
|
||||
"@rspack/binding-win32-ia32-msvc@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-win32-ia32-msvc@npm:1.5.1"
|
||||
conditions: os=win32 & cpu=ia32
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding-win32-x64-msvc@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding-win32-x64-msvc@npm:1.5.2"
|
||||
"@rspack/binding-win32-x64-msvc@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding-win32-x64-msvc@npm:1.5.1"
|
||||
conditions: os=win32 & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/binding@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/binding@npm:1.5.2"
|
||||
"@rspack/binding@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/binding@npm:1.5.1"
|
||||
dependencies:
|
||||
"@rspack/binding-darwin-arm64": "npm:1.5.2"
|
||||
"@rspack/binding-darwin-x64": "npm:1.5.2"
|
||||
"@rspack/binding-linux-arm64-gnu": "npm:1.5.2"
|
||||
"@rspack/binding-linux-arm64-musl": "npm:1.5.2"
|
||||
"@rspack/binding-linux-x64-gnu": "npm:1.5.2"
|
||||
"@rspack/binding-linux-x64-musl": "npm:1.5.2"
|
||||
"@rspack/binding-wasm32-wasi": "npm:1.5.2"
|
||||
"@rspack/binding-win32-arm64-msvc": "npm:1.5.2"
|
||||
"@rspack/binding-win32-ia32-msvc": "npm:1.5.2"
|
||||
"@rspack/binding-win32-x64-msvc": "npm:1.5.2"
|
||||
"@rspack/binding-darwin-arm64": "npm:1.5.1"
|
||||
"@rspack/binding-darwin-x64": "npm:1.5.1"
|
||||
"@rspack/binding-linux-arm64-gnu": "npm:1.5.1"
|
||||
"@rspack/binding-linux-arm64-musl": "npm:1.5.1"
|
||||
"@rspack/binding-linux-x64-gnu": "npm:1.5.1"
|
||||
"@rspack/binding-linux-x64-musl": "npm:1.5.1"
|
||||
"@rspack/binding-wasm32-wasi": "npm:1.5.1"
|
||||
"@rspack/binding-win32-arm64-msvc": "npm:1.5.1"
|
||||
"@rspack/binding-win32-ia32-msvc": "npm:1.5.1"
|
||||
"@rspack/binding-win32-x64-msvc": "npm:1.5.1"
|
||||
dependenciesMeta:
|
||||
"@rspack/binding-darwin-arm64":
|
||||
optional: true
|
||||
@@ -4097,23 +4097,23 @@ __metadata:
|
||||
optional: true
|
||||
"@rspack/binding-win32-x64-msvc":
|
||||
optional: true
|
||||
checksum: 10/71c41c6c878445ea561b7a02d9f75ec13ce170f5d63053debd72dee82a07d23c491a55526cfe9e0aceb5ee1154a07bbe69121deb2821d1a3ac5021eea75d9114
|
||||
checksum: 10/a6756a35bda55fd9e21b1ce142ca18e228d92832dc213027a19314981f8f12e6510dd862a9724ee96dee61755b3dd30ce73b2bb117d150e9f5ce73ba8fe4b57a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@rspack/core@npm:1.5.2":
|
||||
version: 1.5.2
|
||||
resolution: "@rspack/core@npm:1.5.2"
|
||||
"@rspack/core@npm:1.5.1":
|
||||
version: 1.5.1
|
||||
resolution: "@rspack/core@npm:1.5.1"
|
||||
dependencies:
|
||||
"@module-federation/runtime-tools": "npm:0.18.0"
|
||||
"@rspack/binding": "npm:1.5.2"
|
||||
"@rspack/binding": "npm:1.5.1"
|
||||
"@rspack/lite-tapable": "npm:1.0.1"
|
||||
peerDependencies:
|
||||
"@swc/helpers": ">=0.5.1"
|
||||
peerDependenciesMeta:
|
||||
"@swc/helpers":
|
||||
optional: true
|
||||
checksum: 10/e72023c8eea0ed351d950a28b6897ca7143ad749a65380ab855e12f96f8ce692ab044c14acf9b030bca740b722c197ad3075eaadac4fe480389e3131c519ac0e
|
||||
checksum: 10/b7a6269d5bdbcad140d172ebe951f4693711573d4f38e4c676c250a9cc6c1bdf602ad5187eeacc07ff12b74d510b746c92e3f112c8ab4dca46846c595d2876b0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -4496,10 +4496,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/culori@npm:4.0.1":
|
||||
version: 4.0.1
|
||||
resolution: "@types/culori@npm:4.0.1"
|
||||
checksum: 10/34240fce795cdcbeefbbb4ec1fd6adec1c7edafa949131586176649c21d912236d151bf7af53de161454a6c2fa259a4ddd54f204c66e67e8b9ecfd90b9021c68
|
||||
"@types/culori@npm:4.0.0":
|
||||
version: 4.0.0
|
||||
resolution: "@types/culori@npm:4.0.0"
|
||||
checksum: 10/62a9058d6125fe489ca1e7df27ac9837ea7a34c772b8bed8e5e00177b141574830efaa0c93363e9532878490d3245a9c9c8183ebee181a450097584af0cfefc1
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -4685,25 +4685,25 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/leaflet-draw@npm:1.0.13":
|
||||
version: 1.0.13
|
||||
resolution: "@types/leaflet-draw@npm:1.0.13"
|
||||
"@types/leaflet-draw@npm:1.0.12":
|
||||
version: 1.0.12
|
||||
resolution: "@types/leaflet-draw@npm:1.0.12"
|
||||
dependencies:
|
||||
"@types/leaflet": "npm:^1.9"
|
||||
checksum: 10/1a6c3a8b3011f15362108b522fa6d17cca888a7f866e2e582dac921e2c748d9e24685d83b2a5ed1d97e3a1448b0f5b1879a42f1143ffdeb36b71c7fb9b94e9f5
|
||||
"@types/leaflet": "npm:*"
|
||||
checksum: 10/2a73a152e6a9405502789d7b2d8ffe18d679da03533e17c2a1fe722e78c8ed8cf3daf6a56aae5572c4dd86257811286b5e06b0cb307141a241618f33a360618a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/leaflet.markercluster@npm:1.5.6":
|
||||
version: 1.5.6
|
||||
resolution: "@types/leaflet.markercluster@npm:1.5.6"
|
||||
"@types/leaflet.markercluster@npm:1.5.5":
|
||||
version: 1.5.5
|
||||
resolution: "@types/leaflet.markercluster@npm:1.5.5"
|
||||
dependencies:
|
||||
"@types/leaflet": "npm:^1.9"
|
||||
checksum: 10/6ddc628fa6d8a3735f154418115b8b0225fefc74d1d472d0aa987a945a92ed6e0dcc0bcaad5a65d104f38e7445cddbf91d75de97b970b6d173e43afa373d8761
|
||||
"@types/leaflet": "npm:*"
|
||||
checksum: 10/17647d187ed8c9c38124005c3c45c0c7998c6359d8783e2ea162f9649b151862750c813eba2373054e90156a11a37af2b220429f937b302889b9d6e2105bf2ca
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/leaflet@npm:1.9.20, @types/leaflet@npm:^1.9":
|
||||
"@types/leaflet@npm:*, @types/leaflet@npm:1.9.20":
|
||||
version: 1.9.20
|
||||
resolution: "@types/leaflet@npm:1.9.20"
|
||||
dependencies:
|
||||
@@ -4964,106 +4964,106 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/eslint-plugin@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:8.42.0"
|
||||
"@typescript-eslint/eslint-plugin@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/eslint-plugin@npm:8.41.0"
|
||||
dependencies:
|
||||
"@eslint-community/regexpp": "npm:^4.10.0"
|
||||
"@typescript-eslint/scope-manager": "npm:8.42.0"
|
||||
"@typescript-eslint/type-utils": "npm:8.42.0"
|
||||
"@typescript-eslint/utils": "npm:8.42.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.42.0"
|
||||
"@typescript-eslint/scope-manager": "npm:8.41.0"
|
||||
"@typescript-eslint/type-utils": "npm:8.41.0"
|
||||
"@typescript-eslint/utils": "npm:8.41.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.41.0"
|
||||
graphemer: "npm:^1.4.0"
|
||||
ignore: "npm:^7.0.0"
|
||||
natural-compare: "npm:^1.4.0"
|
||||
ts-api-utils: "npm:^2.1.0"
|
||||
peerDependencies:
|
||||
"@typescript-eslint/parser": ^8.42.0
|
||||
"@typescript-eslint/parser": ^8.41.0
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/fb5b0e0785f9fa9d5ef88e78ff189334b2d1c558efd7b5063508d50275224a8aa38d4af0478228b90d6be6620289384a8d814f05e0af8c952c204515c0f3514e
|
||||
checksum: 10/b96e3fd9e8ae2c289aa7f1c0d2fbf89c608d37f54162a893bac5895318b05d21d3fd456cf7a6adf165915a8212f773f1bae9b4d83f732441864f6d92d083ed99
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/parser@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/parser@npm:8.42.0"
|
||||
"@typescript-eslint/parser@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/parser@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/scope-manager": "npm:8.42.0"
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.42.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.42.0"
|
||||
"@typescript-eslint/scope-manager": "npm:8.41.0"
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.41.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.41.0"
|
||||
debug: "npm:^4.3.4"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/25eb2d08c118742dc01c2aa279ea4ba2d277e2d9a042ffd4f9bda9e94d7ff2aa90b63aad1204a82617a5c63ddd3dd553d927944cd9c8345826484d0d523cf7ad
|
||||
checksum: 10/d4ba418aa62e08d49a5b953c9debd52674c30b9b2bb7bf2efc173a22ad3942df72cd83072beac06d98dad82741baf502a55fc648925ca407b01abdc908675f67
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/project-service@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/project-service@npm:8.42.0"
|
||||
"@typescript-eslint/project-service@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/project-service@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/tsconfig-utils": "npm:^8.42.0"
|
||||
"@typescript-eslint/types": "npm:^8.42.0"
|
||||
"@typescript-eslint/tsconfig-utils": "npm:^8.41.0"
|
||||
"@typescript-eslint/types": "npm:^8.41.0"
|
||||
debug: "npm:^4.3.4"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/3e91fd4b4d60edd6fe3e108e8e75947de8aa060aab1de63c23017e8afeca72ef405faa6fcdd17e8aa0023261a81135d095072dc31343c57395e50450258d9fa5
|
||||
checksum: 10/ff8315de005ea7072ecd208b50b35fa01db034f110f30f415faa9c9441648494e5322723a0a4267beb28524babd6b04b349c32f2a2821f4ae0e9c4d503e1e8f0
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/scope-manager@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/scope-manager@npm:8.42.0"
|
||||
"@typescript-eslint/scope-manager@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/scope-manager@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.42.0"
|
||||
checksum: 10/81be2d908a9d2d83bc9fe5e9219b04277b9fa466bfa7faf45dc076e4b33b39db2fb99b34b8832e329c7db48ddfdc7b78f6c92b564cd6eec99e124d3feaad8645
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.41.0"
|
||||
checksum: 10/4fc1dd6b3390d3a770c228dac227f35ff1126034fce484ab5e5a4fdbe2dab5dca1c8de3c528708320fee021adec1a1260ee45ed2aef9f7e3fdfbb1faf2191f9f
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/tsconfig-utils@npm:8.42.0, @typescript-eslint/tsconfig-utils@npm:^8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/tsconfig-utils@npm:8.42.0"
|
||||
"@typescript-eslint/tsconfig-utils@npm:8.41.0, @typescript-eslint/tsconfig-utils@npm:^8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/tsconfig-utils@npm:8.41.0"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/927aa127983a62ddcbfbcd18806fd278e0bf18fade3cca658946f9ff4915e6a5c5cc85926afaa490512c88dd2950b2059f22b50b6d1f4461c9dbd755a4c71c1c
|
||||
checksum: 10/522d54252f9647d22e46f963df6bafe98aa0572b021e6acf7474c40f1a68afa6753f23a0a125abb1d792a89a1b1cc654d918553a03d08f769139f2f40b0d026c
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/type-utils@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/type-utils@npm:8.42.0"
|
||||
"@typescript-eslint/type-utils@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/type-utils@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.42.0"
|
||||
"@typescript-eslint/utils": "npm:8.42.0"
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.41.0"
|
||||
"@typescript-eslint/utils": "npm:8.41.0"
|
||||
debug: "npm:^4.3.4"
|
||||
ts-api-utils: "npm:^2.1.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/8d876bbd23c956b604d973c49720060c251f4d8cab255f1fd04826a9a1e3ab7c1310400d49d9ec6cdac3288d7a23cd9fb48d42777651ba53c02b5e1a34efd6e9
|
||||
checksum: 10/6c4c693c1ee3d1a1a3635898d59f1a3bcdf224be84284ea95a21fa68a3206bae32ce04d371df366fcad250a3eca3af723ed6ca1b4aefba238d4e553797c2dc9d
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/types@npm:8.42.0, @typescript-eslint/types@npm:^8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/types@npm:8.42.0"
|
||||
checksum: 10/7c39a35e5bb7083070872edc797ea60a3d6ceff0e3bdf85701919b71da83a51963562053a4b35c9e2a2b08c138fb595e14bc0b5c450e671a26059b58f8d8b4f4
|
||||
"@typescript-eslint/types@npm:8.41.0, @typescript-eslint/types@npm:^8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/types@npm:8.41.0"
|
||||
checksum: 10/e2fe5d9125264a1b1310fff7ac65e827da9885219d7f910dba090dcf7d4242830cb96695c7257634b22e1947943a2e890f9740536d95612452e5752385ab6a5b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/typescript-estree@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:8.42.0"
|
||||
"@typescript-eslint/typescript-estree@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/typescript-estree@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/project-service": "npm:8.42.0"
|
||||
"@typescript-eslint/tsconfig-utils": "npm:8.42.0"
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.42.0"
|
||||
"@typescript-eslint/project-service": "npm:8.41.0"
|
||||
"@typescript-eslint/tsconfig-utils": "npm:8.41.0"
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
"@typescript-eslint/visitor-keys": "npm:8.41.0"
|
||||
debug: "npm:^4.3.4"
|
||||
fast-glob: "npm:^3.3.2"
|
||||
is-glob: "npm:^4.0.3"
|
||||
@@ -5072,32 +5072,32 @@ __metadata:
|
||||
ts-api-utils: "npm:^2.1.0"
|
||||
peerDependencies:
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/9bb5df97a2ac31e6e3ee6941e10702498a76d23235ba28a23d93e09aa75a2cbcd40dc74935d86706c8e2e55e1a8b6a34bb9fb234461920ed3d8a5abed68ba36b
|
||||
checksum: 10/e039815d2ee03727fadb32c460e0c7df71a35b6c93a87e019c63836c53e51ce41f1975b32c9e5bcc840f4cd49c7bf7715c95df149f915379ec4c559d02436623
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/utils@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/utils@npm:8.42.0"
|
||||
"@typescript-eslint/utils@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/utils@npm:8.41.0"
|
||||
dependencies:
|
||||
"@eslint-community/eslint-utils": "npm:^4.7.0"
|
||||
"@typescript-eslint/scope-manager": "npm:8.42.0"
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.42.0"
|
||||
"@typescript-eslint/scope-manager": "npm:8.41.0"
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.41.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/41c6c0d01c414c94d7109e21deee73b416547b3be26240d0237a3004c6198f146afefc75feee5333bc957ece6a0856518750655e794fd68c96feec1001edbfe8
|
||||
checksum: 10/863565c0891d89ee27497571092783a7fa90e281a7643f1bda5d9e8b94aea2acbc851e81141ce7a53ddea3638a0527ea165801dd9611f5532940e4d413c955a8
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@typescript-eslint/visitor-keys@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:8.42.0"
|
||||
"@typescript-eslint/visitor-keys@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "@typescript-eslint/visitor-keys@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/types": "npm:8.42.0"
|
||||
"@typescript-eslint/types": "npm:8.41.0"
|
||||
eslint-visitor-keys: "npm:^4.2.1"
|
||||
checksum: 10/ef3aeabf7b01eb72e176053a4fe7a4c4f0769a9f58d1f7a920c97d365305b950c402ad34227209781996ae187652ccf0f47c31015f992c502b5fa898a9d44bd5
|
||||
checksum: 10/3c764be2f0d3b212c2cb7d0cc8a7b0ed378feb58883654471fd8ee943f1e124c0b78df92fe14368ceb46016b0e3ae1c47e2630ec3599aa7b4bd54f7793747657
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -6561,7 +6561,7 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"chalk@npm:^5.0.1, chalk@npm:^5.6.0":
|
||||
"chalk@npm:^5.0.1, chalk@npm:^5.5.0":
|
||||
version: 5.6.0
|
||||
resolution: "chalk@npm:5.6.0"
|
||||
checksum: 10/f0e0646a72adbd0f6e73441d3872d7f2f40ba98052924f08a30c10634ec6b1e2cd19cc3c40cc21081dad640e2a1a2749030418571690b89bd7782babf7f89866
|
||||
@@ -9317,13 +9317,13 @@ __metadata:
|
||||
"@babel/runtime": "npm:7.28.3"
|
||||
"@braintree/sanitize-url": "npm:7.1.1"
|
||||
"@bundle-stats/plugin-webpack-filter": "npm:4.21.3"
|
||||
"@codemirror/autocomplete": "npm:6.18.7"
|
||||
"@codemirror/autocomplete": "npm:6.18.6"
|
||||
"@codemirror/commands": "npm:6.8.1"
|
||||
"@codemirror/language": "npm:6.11.3"
|
||||
"@codemirror/legacy-modes": "npm:6.5.1"
|
||||
"@codemirror/search": "npm:6.5.11"
|
||||
"@codemirror/state": "npm:6.5.2"
|
||||
"@codemirror/view": "npm:6.38.2"
|
||||
"@codemirror/view": "npm:6.38.1"
|
||||
"@egjs/hammerjs": "npm:2.0.17"
|
||||
"@formatjs/intl-datetimeformat": "npm:6.18.0"
|
||||
"@formatjs/intl-displaynames": "npm:6.8.11"
|
||||
@@ -9377,7 +9377,7 @@ __metadata:
|
||||
"@octokit/rest": "npm:22.0.0"
|
||||
"@replit/codemirror-indentation-markers": "npm:6.5.3"
|
||||
"@rsdoctor/rspack-plugin": "npm:1.2.3"
|
||||
"@rspack/core": "npm:1.5.2"
|
||||
"@rspack/core": "npm:1.5.1"
|
||||
"@rspack/dev-server": "npm:1.1.4"
|
||||
"@shoelace-style/shoelace": "npm:2.20.1"
|
||||
"@swc/helpers": "npm:0.5.17"
|
||||
@@ -9388,12 +9388,12 @@ __metadata:
|
||||
"@types/chromecast-caf-receiver": "npm:6.0.24"
|
||||
"@types/chromecast-caf-sender": "npm:1.0.11"
|
||||
"@types/color-name": "npm:2.0.0"
|
||||
"@types/culori": "npm:4.0.1"
|
||||
"@types/culori": "npm:4.0.0"
|
||||
"@types/html-minifier-terser": "npm:7.0.2"
|
||||
"@types/js-yaml": "npm:4.0.9"
|
||||
"@types/leaflet": "npm:1.9.20"
|
||||
"@types/leaflet-draw": "npm:1.0.13"
|
||||
"@types/leaflet.markercluster": "npm:1.5.6"
|
||||
"@types/leaflet-draw": "npm:1.0.12"
|
||||
"@types/leaflet.markercluster": "npm:1.5.5"
|
||||
"@types/lodash.merge": "npm:4.6.9"
|
||||
"@types/luxon": "npm:3.7.1"
|
||||
"@types/mocha": "npm:10.0.10"
|
||||
@@ -9458,7 +9458,7 @@ __metadata:
|
||||
leaflet: "npm:1.9.4"
|
||||
leaflet-draw: "patch:leaflet-draw@npm%3A1.0.4#./.yarn/patches/leaflet-draw-npm-1.0.4-0ca0ebcf65.patch"
|
||||
leaflet.markercluster: "npm:1.5.3"
|
||||
lint-staged: "npm:16.1.6"
|
||||
lint-staged: "npm:16.1.5"
|
||||
lit: "npm:3.3.1"
|
||||
lit-analyzer: "npm:2.0.3"
|
||||
lit-html: "npm:3.3.1"
|
||||
@@ -9488,7 +9488,7 @@ __metadata:
|
||||
tinykeys: "npm:3.0.0"
|
||||
ts-lit-plugin: "npm:2.0.2"
|
||||
typescript: "npm:5.9.2"
|
||||
typescript-eslint: "npm:8.42.0"
|
||||
typescript-eslint: "npm:8.41.0"
|
||||
ua-parser-js: "npm:2.0.4"
|
||||
vite-tsconfig-paths: "npm:5.1.4"
|
||||
vitest: "npm:3.2.4"
|
||||
@@ -10826,15 +10826,15 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"lint-staged@npm:16.1.6":
|
||||
version: 16.1.6
|
||||
resolution: "lint-staged@npm:16.1.6"
|
||||
"lint-staged@npm:16.1.5":
|
||||
version: 16.1.5
|
||||
resolution: "lint-staged@npm:16.1.5"
|
||||
dependencies:
|
||||
chalk: "npm:^5.6.0"
|
||||
chalk: "npm:^5.5.0"
|
||||
commander: "npm:^14.0.0"
|
||||
debug: "npm:^4.4.1"
|
||||
lilconfig: "npm:^3.1.3"
|
||||
listr2: "npm:^9.0.3"
|
||||
listr2: "npm:^9.0.1"
|
||||
micromatch: "npm:^4.0.8"
|
||||
nano-spawn: "npm:^1.0.2"
|
||||
pidtree: "npm:^0.6.0"
|
||||
@@ -10842,13 +10842,13 @@ __metadata:
|
||||
yaml: "npm:^2.8.1"
|
||||
bin:
|
||||
lint-staged: bin/lint-staged.js
|
||||
checksum: 10/922b4392ae5d3d56130e4eba706c2fa6151d5da5e21f57ab601b1d6ce9cc635ceb5e4c3dc00e7da83ba8f0cb244b82604469c7ea1470b1e6b6ea0fc12454aa08
|
||||
checksum: 10/02b284f89d7b8118e1b27b1f2068017ed84407e57a1166463789caa65f3429f206372c483bc37304ce03dcb30bd1dd3e624f0502ae4973d440fe73cdd04e0747
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"listr2@npm:^9.0.3":
|
||||
version: 9.0.3
|
||||
resolution: "listr2@npm:9.0.3"
|
||||
"listr2@npm:^9.0.1":
|
||||
version: 9.0.1
|
||||
resolution: "listr2@npm:9.0.1"
|
||||
dependencies:
|
||||
cli-truncate: "npm:^4.0.0"
|
||||
colorette: "npm:^2.0.20"
|
||||
@@ -10856,7 +10856,7 @@ __metadata:
|
||||
log-update: "npm:^6.1.0"
|
||||
rfdc: "npm:^1.4.1"
|
||||
wrap-ansi: "npm:^9.0.0"
|
||||
checksum: 10/8cb7cd1cec0f4360502c14cd54af948f831134811d84d3fd2b38b2fa11ea66ee0b15ca8b00b8088d28d7381031afbe755ee3f46bc2c03c2c96c433f04296bd44
|
||||
checksum: 10/ac5f98317fe17588d304bb4dce47ea22892f223511948656f588c5ab47b99d5d97ca4b812b4fb1237db8ec8d86a504875d8d6a0bb24c877553537eab44941983
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -14527,18 +14527,18 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"typescript-eslint@npm:8.42.0":
|
||||
version: 8.42.0
|
||||
resolution: "typescript-eslint@npm:8.42.0"
|
||||
"typescript-eslint@npm:8.41.0":
|
||||
version: 8.41.0
|
||||
resolution: "typescript-eslint@npm:8.41.0"
|
||||
dependencies:
|
||||
"@typescript-eslint/eslint-plugin": "npm:8.42.0"
|
||||
"@typescript-eslint/parser": "npm:8.42.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.42.0"
|
||||
"@typescript-eslint/utils": "npm:8.42.0"
|
||||
"@typescript-eslint/eslint-plugin": "npm:8.41.0"
|
||||
"@typescript-eslint/parser": "npm:8.41.0"
|
||||
"@typescript-eslint/typescript-estree": "npm:8.41.0"
|
||||
"@typescript-eslint/utils": "npm:8.41.0"
|
||||
peerDependencies:
|
||||
eslint: ^8.57.0 || ^9.0.0
|
||||
typescript: ">=4.8.4 <6.0.0"
|
||||
checksum: 10/7f71501823b2c1e87e89ff00d6d8eb40c7514630dbb6b7b44c4dd830c95709357270763df2d711a8ea7bb0b58bd69534f15b01db4550dc6e745df8fec8f6a3ae
|
||||
checksum: 10/a398a367b3a674bcdb74f060e0b06aacb9e8bd0637079c5079ff66a43a35286098b97d71fca1b81b738c0df840fda4b53aeee03ed0aacef03f9644c61a68960e
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user