mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Always show "polling for updates" switch (#16629)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
da0cf9d950
commit
85e7986b44
@ -86,8 +86,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||
dialogInitialFocus
|
||||
></ha-switch>
|
||||
</ha-formfield>
|
||||
${this._allowUpdatePolling()
|
||||
? html`
|
||||
|
||||
<ha-formfield
|
||||
.label=${html`<p>
|
||||
${this.hass.localize(
|
||||
@ -111,8 +110,6 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||
.disabled=${this._submitting}
|
||||
></ha-switch>
|
||||
</ha-formfield>
|
||||
`
|
||||
: ""}
|
||||
<mwc-button
|
||||
slot="secondaryAction"
|
||||
@click=${this.closeDialog}
|
||||
@ -131,14 +128,6 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||
`;
|
||||
}
|
||||
|
||||
private _allowUpdatePolling() {
|
||||
return (
|
||||
this._params!.manifest &&
|
||||
(this._params!.manifest.iot_class === "local_polling" ||
|
||||
this._params!.manifest.iot_class === "cloud_polling")
|
||||
);
|
||||
}
|
||||
|
||||
private _disableNewEntitiesChanged(ev: Event): void {
|
||||
this._error = undefined;
|
||||
this._disableNewEntities = !(ev.target as HaSwitch).checked;
|
||||
@ -154,9 +143,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
||||
const data: ConfigEntryMutableParams = {
|
||||
pref_disable_new_entities: this._disableNewEntities,
|
||||
};
|
||||
if (this._allowUpdatePolling()) {
|
||||
data.pref_disable_polling = this._disablePolling;
|
||||
}
|
||||
try {
|
||||
const result = await updateConfigEntry(
|
||||
this.hass,
|
||||
|
Loading…
x
Reference in New Issue
Block a user