Do not show error message when action has no response in dev tools (#27156)

This commit is contained in:
Paul Bottein
2025-09-24 19:19:31 +02:00
parent e42c5a3254
commit a166b4e9b6
2 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ import type { Action } from "./script";
export const callExecuteScript = (
hass: HomeAssistant,
sequence: Action | Action[]
): Promise<{ context: Context; response: Record<string, any> }> =>
): Promise<{ context: Context; response: Record<string, any> | null }> =>
hass.callWS({
type: "execute_script",
sequence,

View File

@@ -51,7 +51,7 @@ class HaPanelDevAction extends LitElement {
@state() private _response?: {
domain: string;
service: string;
result: Record<string, any>;
result: Record<string, any> | null;
media?: Promise<TemplateResult | typeof nothing>;
};
@@ -205,7 +205,7 @@ class HaPanelDevAction extends LitElement {
</ha-progress-button>
</div>
</div>
${this._response
${this._response?.result
? html`<div class="content response">
<ha-card
.header=${this.hass.localize(
@@ -491,7 +491,7 @@ class HaPanelDevAction extends LitElement {
service,
result,
media:
"media_source_id" in result
result && "media_source_id" in result
? resolveMediaSource(this.hass, result.media_source_id).then(
(resolved) =>
resolved.mime_type.startsWith("image/")