mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Remove time from assist dev tools (#17079)
This commit is contained in:
parent
de7f055419
commit
f6d06f5e26
@ -5,7 +5,6 @@ import "../../../components/ha-button";
|
||||
import "../../../components/ha-code-editor";
|
||||
import "../../../components/ha-language-picker";
|
||||
import "../../../components/ha-textarea";
|
||||
import "../../../components/ha-absolute-time";
|
||||
import type { HaTextArea } from "../../../components/ha-textarea";
|
||||
import {
|
||||
AssitDebugResult,
|
||||
@ -22,7 +21,6 @@ type SentenceParsingResult = {
|
||||
sentence: string;
|
||||
language: string;
|
||||
result: AssitDebugResult | null;
|
||||
time: Date;
|
||||
};
|
||||
|
||||
@customElement("developer-tools-assist")
|
||||
@ -75,8 +73,6 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
|
||||
this._sentencesInput.value = "";
|
||||
|
||||
const now = new Date();
|
||||
|
||||
const newResults: SentenceParsingResult[] = [];
|
||||
sentences.forEach((sentence, index) => {
|
||||
const result = results[index];
|
||||
@ -85,7 +81,6 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
sentence,
|
||||
language: this._language!,
|
||||
result,
|
||||
time: now,
|
||||
});
|
||||
});
|
||||
this._results = [...newResults, ...this._results];
|
||||
@ -152,7 +147,7 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
</ha-card>
|
||||
|
||||
${this._results.map((r) => {
|
||||
const { sentence, result, language, time } = r;
|
||||
const { sentence, result, language } = r;
|
||||
const matched = result != null;
|
||||
|
||||
return html`
|
||||
@ -163,34 +158,22 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
||||
<p>${matched ? "✅" : "❌"}</p>
|
||||
</div>
|
||||
<div class="info">
|
||||
<p>
|
||||
Language: ${formatLanguageCode(
|
||||
language,
|
||||
this.hass.locale
|
||||
)} (${language})
|
||||
</p>
|
||||
<p>Execution time:
|
||||
<ha-absolute-time .hass=${this.hass} .datetime=${time}>
|
||||
</ha-absolute-time>
|
||||
</p>
|
||||
|
||||
</p>
|
||||
Language: ${formatLanguageCode(language, this.hass.locale)}
|
||||
(${language})
|
||||
</div>
|
||||
${
|
||||
result
|
||||
? html`
|
||||
<ha-code-editor
|
||||
mode="yaml"
|
||||
.hass=${this.hass}
|
||||
.value=${dump(result).trimRight()}
|
||||
read-only
|
||||
dir="ltr"
|
||||
></ha-code-editor>
|
||||
`
|
||||
: html`<ha-alert alert-type="error"
|
||||
>No intent matched</ha-alert
|
||||
>`
|
||||
}
|
||||
${result
|
||||
? html`
|
||||
<ha-code-editor
|
||||
mode="yaml"
|
||||
.hass=${this.hass}
|
||||
.value=${dump(result).trimRight()}
|
||||
read-only
|
||||
dir="ltr"
|
||||
></ha-code-editor>
|
||||
`
|
||||
: html`<ha-alert alert-type="error">
|
||||
No intent matched
|
||||
</ha-alert>`}
|
||||
</div>
|
||||
</ha-card>
|
||||
`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user