v0.14.4
This commit is contained in:
+2
-4
@@ -143,7 +143,6 @@ function homeAssistantSettingsBodyFromForm(form) {
|
||||
const raw = Object.fromEntries(new FormData(form));
|
||||
const body = {
|
||||
url: raw.ha_url,
|
||||
default_entity_id: raw.ha_entity_id,
|
||||
outdoor_entity_id: raw.ha_outdoor_entity_id,
|
||||
sensor_stale_after_seconds: Math.max(60, Math.min(86400, Math.round(Number(raw.ha_sensor_stale_after_minutes || 5) * 60))),
|
||||
allow_invalid_tls: form.ha_allow_invalid_tls.checked,
|
||||
@@ -289,10 +288,9 @@ $('#haTest').addEventListener('click', async event => {
|
||||
button.textContent = tr('settings.testingHa');
|
||||
try {
|
||||
await saveHomeAssistantSettings(form, false);
|
||||
const entity = form.ha_entity_id.value || form.ha_outdoor_entity_id.value || null;
|
||||
const result = await api('/api/integrations/home-assistant/test', { method: 'POST', body: { entity_id: entity } });
|
||||
await api('/api/integrations/home-assistant/test', { method: 'POST' });
|
||||
markFormClean(form);
|
||||
toast(tr('toast.haTemperature', { temperature: result.temperature_c.toFixed(1) }));
|
||||
toast(tr('toast.haConnected'));
|
||||
} catch (error) { presentFormError(form, error); }
|
||||
finally { button.disabled = false; button.textContent = idle; }
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user