mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +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
|
dialogInitialFocus
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
${this._allowUpdatePolling()
|
|
||||||
? html`
|
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${html`<p>
|
.label=${html`<p>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
@ -111,8 +110,6 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
|||||||
.disabled=${this._submitting}
|
.disabled=${this._submitting}
|
||||||
></ha-switch>
|
></ha-switch>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
`
|
|
||||||
: ""}
|
|
||||||
<mwc-button
|
<mwc-button
|
||||||
slot="secondaryAction"
|
slot="secondaryAction"
|
||||||
@click=${this.closeDialog}
|
@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 {
|
private _disableNewEntitiesChanged(ev: Event): void {
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
this._disableNewEntities = !(ev.target as HaSwitch).checked;
|
this._disableNewEntities = !(ev.target as HaSwitch).checked;
|
||||||
@ -154,9 +143,7 @@ class DialogConfigEntrySystemOptions extends LitElement {
|
|||||||
const data: ConfigEntryMutableParams = {
|
const data: ConfigEntryMutableParams = {
|
||||||
pref_disable_new_entities: this._disableNewEntities,
|
pref_disable_new_entities: this._disableNewEntities,
|
||||||
};
|
};
|
||||||
if (this._allowUpdatePolling()) {
|
|
||||||
data.pref_disable_polling = this._disablePolling;
|
data.pref_disable_polling = this._disablePolling;
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
const result = await updateConfigEntry(
|
const result = await updateConfigEntry(
|
||||||
this.hass,
|
this.hass,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user