mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Move error to the is valid check
This commit is contained in:
parent
f64b96ac5d
commit
c4fd846451
@ -199,6 +199,15 @@ class HaPanelDevService extends LitElement {
|
||||
if (!serviceData?.service) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this._error = undefined;
|
||||
if (hasTemplate(this._serviceData!)) {
|
||||
this._error = this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.services.no_templates"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const domain = computeDomain(serviceData.service);
|
||||
const service = computeObjectId(serviceData.service);
|
||||
if (!domain || !service) {
|
||||
@ -260,14 +269,6 @@ class HaPanelDevService extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
this._error = undefined;
|
||||
if (hasTemplate(this._serviceData!)) {
|
||||
this._error = this.hass.localize(
|
||||
"ui.panel.developer-tools.tabs.services.no_templates"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.hass.callService(
|
||||
domain,
|
||||
service,
|
||||
|
Loading…
x
Reference in New Issue
Block a user