mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 22:07:20 +00:00
Fix possibility to enable entity disabled by integration (#12121)
Co-authored-by: Zack Barett <zackbarett@hey.com>
This commit is contained in:
parent
27ca61ec85
commit
a58b4fb262
@ -264,7 +264,9 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
)}:
|
)}:
|
||||||
</div>
|
</div>
|
||||||
<div class="secondary">
|
<div class="secondary">
|
||||||
${this._disabledBy && this._disabledBy !== "user"
|
${this._disabledBy &&
|
||||||
|
this._disabledBy !== "user" &&
|
||||||
|
this._disabledBy !== "integration"
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
"ui.dialogs.entity_registry.editor.enabled_cause",
|
"ui.dialogs.entity_registry.editor.enabled_cause",
|
||||||
"cause",
|
"cause",
|
||||||
@ -286,7 +288,9 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
.checked=${!this._hiddenBy && !this._disabledBy}
|
.checked=${!this._hiddenBy && !this._disabledBy}
|
||||||
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
||||||
this._device?.disabled_by ||
|
this._device?.disabled_by ||
|
||||||
(this._disabledBy && this._disabledBy !== "user")}
|
(this._disabledBy &&
|
||||||
|
this._disabledBy !== "user" &&
|
||||||
|
this._disabledBy !== "integration")}
|
||||||
@change=${this._viewStatusChanged}
|
@change=${this._viewStatusChanged}
|
||||||
></ha-radio>
|
></ha-radio>
|
||||||
</mwc-formfield>
|
</mwc-formfield>
|
||||||
@ -301,7 +305,9 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
.checked=${this._hiddenBy !== null}
|
.checked=${this._hiddenBy !== null}
|
||||||
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
||||||
Boolean(this._device?.disabled_by) ||
|
Boolean(this._device?.disabled_by) ||
|
||||||
(this._disabledBy && this._disabledBy !== "user")}
|
(this._disabledBy &&
|
||||||
|
this._disabledBy !== "user" &&
|
||||||
|
this._disabledBy !== "integration")}
|
||||||
@change=${this._viewStatusChanged}
|
@change=${this._viewStatusChanged}
|
||||||
></ha-radio>
|
></ha-radio>
|
||||||
</mwc-formfield>
|
</mwc-formfield>
|
||||||
@ -316,7 +322,9 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
.checked=${this._disabledBy !== null}
|
.checked=${this._disabledBy !== null}
|
||||||
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
.disabled=${(this._hiddenBy && this._hiddenBy !== "user") ||
|
||||||
Boolean(this._device?.disabled_by) ||
|
Boolean(this._device?.disabled_by) ||
|
||||||
(this._disabledBy && this._disabledBy !== "user")}
|
(this._disabledBy &&
|
||||||
|
this._disabledBy !== "user" &&
|
||||||
|
this._disabledBy !== "integration")}
|
||||||
@change=${this._viewStatusChanged}
|
@change=${this._viewStatusChanged}
|
||||||
></ha-radio>
|
></ha-radio>
|
||||||
</mwc-formfield>
|
</mwc-formfield>
|
||||||
@ -378,7 +386,7 @@ export class EntityRegistrySettings extends SubscribeMixin(LitElement) {
|
|||||||
class="warning"
|
class="warning"
|
||||||
@click=${this._confirmDeleteEntry}
|
@click=${this._confirmDeleteEntry}
|
||||||
.disabled=${this._submitting ||
|
.disabled=${this._submitting ||
|
||||||
(!this._helperConfigEntry && !stateObj.attributes.restored)}
|
(!this._helperConfigEntry && !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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user