mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 05:57:54 +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) {
|
if (!serviceData?.service) {
|
||||||
return false;
|
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 domain = computeDomain(serviceData.service);
|
||||||
const service = computeObjectId(serviceData.service);
|
const service = computeObjectId(serviceData.service);
|
||||||
if (!domain || !service) {
|
if (!domain || !service) {
|
||||||
@ -260,14 +269,6 @@ class HaPanelDevService extends LitElement {
|
|||||||
return;
|
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(
|
this.hass.callService(
|
||||||
domain,
|
domain,
|
||||||
service,
|
service,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user