mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 21:47:46 +00:00
somethign
This commit is contained in:
parent
672b867847
commit
8bbd108be5
@ -170,6 +170,7 @@ export class DialogEntityEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
|
<div class="entity-id">Entity ID: ${this._params!.entity_id}</div>
|
||||||
${this.hass.localize("ui.dialogs.entity_registry.no_unique_id")}
|
${this.hass.localize("ui.dialogs.entity_registry.no_unique_id")}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@ -193,9 +194,12 @@ export class DialogEntityEditor extends LitElement {
|
|||||||
this.hass,
|
this.hass,
|
||||||
this._params!.entity_id
|
this._params!.entity_id
|
||||||
);
|
);
|
||||||
|
console.log(this._entry);
|
||||||
|
|
||||||
this._loadPlatformSettingTabs();
|
this._loadPlatformSettingTabs();
|
||||||
} catch {
|
} catch {
|
||||||
this._entry = null;
|
this._entry = { entity_id: this._params!.entity_id };
|
||||||
|
this._loadPlatformSettingTabs();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,14 +6,15 @@ import {
|
|||||||
CSSResult,
|
CSSResult,
|
||||||
customElement,
|
customElement,
|
||||||
html,
|
html,
|
||||||
|
internalProperty,
|
||||||
LitElement,
|
LitElement,
|
||||||
property,
|
property,
|
||||||
internalProperty,
|
|
||||||
PropertyValues,
|
PropertyValues,
|
||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import { fireEvent } from "../../../common/dom/fire_event";
|
import { fireEvent } from "../../../common/dom/fire_event";
|
||||||
import { computeDomain } from "../../../common/entity/compute_domain";
|
import { computeDomain } from "../../../common/entity/compute_domain";
|
||||||
|
import { domainIcon } from "../../../common/entity/domain_icon";
|
||||||
import "../../../components/ha-icon-input";
|
import "../../../components/ha-icon-input";
|
||||||
import "../../../components/ha-switch";
|
import "../../../components/ha-switch";
|
||||||
import type { HaSwitch } from "../../../components/ha-switch";
|
import type { HaSwitch } from "../../../components/ha-switch";
|
||||||
@ -86,15 +87,18 @@ export class EntityRegistrySettings extends LitElement {
|
|||||||
.value=${this._name}
|
.value=${this._name}
|
||||||
@value-changed=${this._nameChanged}
|
@value-changed=${this._nameChanged}
|
||||||
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.name")}
|
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.name")}
|
||||||
.placeholder=${this.entry.original_name}
|
.placeholder=${this.entry.original_name ||
|
||||||
.disabled=${this._submitting}
|
stateObj.attributes.friendly_name}
|
||||||
|
.disabled=${this._submitting || !this.entry.config_entry_id}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
<ha-icon-input
|
<ha-icon-input
|
||||||
.value=${this._icon}
|
.value=${this._icon}
|
||||||
@value-changed=${this._iconChanged}
|
@value-changed=${this._iconChanged}
|
||||||
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")}
|
.label=${this.hass.localize("ui.dialogs.entity_registry.editor.icon")}
|
||||||
.placeholder=${this.entry.original_icon}
|
.placeholder=${this.entry.original_icon ||
|
||||||
.disabled=${this._submitting}
|
stateObj.attributes.icon ||
|
||||||
|
domainIcon(computeDomain(this.entry.entity_id))}
|
||||||
|
.disabled=${this._submitting || !this.entry.config_entry_id}
|
||||||
.errorMessage=${this.hass.localize(
|
.errorMessage=${this.hass.localize(
|
||||||
"ui.dialogs.entity_registry.editor.icon_error"
|
"ui.dialogs.entity_registry.editor.icon_error"
|
||||||
)}
|
)}
|
||||||
@ -107,52 +111,58 @@ export class EntityRegistrySettings extends LitElement {
|
|||||||
)}
|
)}
|
||||||
error-message="Domain needs to stay the same"
|
error-message="Domain needs to stay the same"
|
||||||
.invalid=${invalidDomainUpdate}
|
.invalid=${invalidDomainUpdate}
|
||||||
.disabled=${this._submitting}
|
.disabled=${this._submitting || !this.entry.config_entry_id}
|
||||||
></paper-input>
|
></paper-input>
|
||||||
<div class="row">
|
${this.entry.config_entry_id
|
||||||
<ha-switch
|
? html`
|
||||||
.checked=${!this._disabledBy}
|
<div class="row">
|
||||||
@change=${this._disabledByChanged}
|
<ha-switch
|
||||||
>
|
.checked=${!this._disabledBy}
|
||||||
</ha-switch>
|
@change=${this._disabledByChanged}
|
||||||
<div>
|
>
|
||||||
<div>
|
</ha-switch>
|
||||||
${this.hass.localize(
|
<div>
|
||||||
"ui.dialogs.entity_registry.editor.enabled_label"
|
<div>
|
||||||
)}
|
${this.hass.localize(
|
||||||
</div>
|
"ui.dialogs.entity_registry.editor.enabled_label"
|
||||||
<div class="secondary">
|
)}
|
||||||
${this._disabledBy && this._disabledBy !== "user"
|
</div>
|
||||||
? this.hass.localize(
|
<div class="secondary">
|
||||||
"ui.dialogs.entity_registry.editor.enabled_cause",
|
${this._disabledBy && this._disabledBy !== "user"
|
||||||
"cause",
|
? this.hass.localize(
|
||||||
this.hass.localize(
|
"ui.dialogs.entity_registry.editor.enabled_cause",
|
||||||
`config_entry.disabled_by.${this._disabledBy}`
|
"cause",
|
||||||
)
|
this.hass.localize(
|
||||||
)
|
`config_entry.disabled_by.${this._disabledBy}`
|
||||||
: ""}
|
)
|
||||||
${this.hass.localize(
|
)
|
||||||
"ui.dialogs.entity_registry.editor.enabled_description"
|
: ""}
|
||||||
)}
|
${this.hass.localize(
|
||||||
<br />${this.hass.localize(
|
"ui.dialogs.entity_registry.editor.enabled_description"
|
||||||
"ui.dialogs.entity_registry.editor.note"
|
)}
|
||||||
)}
|
<br />${this.hass.localize(
|
||||||
</div>
|
"ui.dialogs.entity_registry.editor.note"
|
||||||
</div>
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<mwc-button
|
<mwc-button
|
||||||
class="warning"
|
class="warning"
|
||||||
@click="${this._confirmDeleteEntry}"
|
@click=${this._confirmDeleteEntry}
|
||||||
.disabled=${this._submitting ||
|
.disabled=${this._submitting ||
|
||||||
!(stateObj && stateObj.attributes.restored)}
|
!(stateObj && stateObj.attributes.restored)}
|
||||||
>
|
>
|
||||||
${this.hass.localize("ui.dialogs.entity_registry.editor.delete")}
|
${this.hass.localize("ui.dialogs.entity_registry.editor.delete")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
<mwc-button
|
<mwc-button
|
||||||
@click="${this._updateEntry}"
|
@click=${this._updateEntry}
|
||||||
.disabled=${invalidDomainUpdate || this._submitting}
|
.disabled=${invalidDomainUpdate ||
|
||||||
|
this._submitting ||
|
||||||
|
!this.entry.config_entry_id}
|
||||||
>
|
>
|
||||||
${this.hass.localize("ui.dialogs.entity_registry.editor.update")}
|
${this.hass.localize("ui.dialogs.entity_registry.editor.update")}
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user