This commit is contained in:
Mateusz Gruszczyński
2026-08-27 23:18:03 +02:00
parent 7465de4b55
commit 016aac0f8d
19 changed files with 147 additions and 52 deletions
+3
View File
@@ -1065,6 +1065,7 @@ function renderHomeAssistantSettings() {
form.ha_token.placeholder = app.settings.home_assistant?.token_configured ? tr('settings.haTokenSaved') : tr('settings.haLongLivedToken');
form.ha_entity_id.value = app.settings.home_assistant?.default_entity_id || '';
form.ha_outdoor_entity_id.value = app.settings.home_assistant?.outdoor_entity_id || '';
form.ha_sensor_stale_after_minutes.value = String(Math.max(1, Math.round(Number(app.settings.home_assistant?.sensor_stale_after_seconds || 300) / 60)));
form.ha_allow_invalid_tls.checked = !!app.settings.home_assistant?.allow_invalid_tls;
form.outdoor_assist_enabled.checked = !!app.settings.outdoor_assist_enabled;
renderSensorAliases();
@@ -2067,6 +2068,7 @@ function currentSettingsBody() {
token: '',
default_entity_id: ha.default_entity_id || '',
outdoor_entity_id: ha.outdoor_entity_id || '',
sensor_stale_after_seconds: Number(ha.sensor_stale_after_seconds || 300),
allow_invalid_tls: !!ha.allow_invalid_tls,
sensor_aliases: {...(ha.sensor_aliases || {})},
},
@@ -2127,6 +2129,7 @@ function homeAssistantSettingsBodyFromForm(form) {
token: raw.ha_token,
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,
sensor_aliases: {...(app.sensorAliases || {})},
};
+2
View File
@@ -187,6 +187,8 @@
<label class="wide"><span data-i18n="settings.haLongLivedToken">Long-Lived Access Token</span><input type="password" name="ha_token" autocomplete="new-password" data-i18n-placeholder="settings.haTokenKeep" placeholder="Leave empty to keep the saved token"></label>
<label class="wide"><span data-i18n="settings.defaultEntity">Default room entity_id</span><input name="ha_entity_id" placeholder="sensor.living_room_temperature"></label>
<label class="wide"><span data-i18n="settings.outdoorEntity">Outdoor temperature entity_id</span><input name="ha_outdoor_entity_id" placeholder="sensor.outdoor_temperature"></label>
<label class="wide"><span data-i18n="settings.haSensorStaleAfterMinutes">Maximum HA sensor reading age (min)</span><input type="number" name="ha_sensor_stale_after_minutes" min="1" max="1440" step="1" value="5"></label>
<p class="field-note wide" data-i18n="settings.haSensorStaleAfterHint">If the HA sensor is not updated within this time, the reading is treated as stale. The thermostat falls back to the GREE sensor when available.</p>
<label class="check wide"><input type="checkbox" name="outdoor_assist_enabled"> <span data-i18n="settings.outdoorAssist">Use outdoor temperature as smart-control assist</span></label>
<label class="check wide"><input type="checkbox" name="ha_allow_invalid_tls"> <span data-i18n="settings.allowInvalidTls">Allow invalid/self-signed HTTPS certificate</span></label>
<p class="field-note wide warning-note" data-i18n="settings.allowInvalidTlsHint">Use only for a trusted local Home Assistant server, for example https://192.168.50.25.</p>
+3
View File
@@ -831,6 +831,7 @@ body.simulation-standalone [data-view="simulation"] { min-height:calc(100vh - 36
/* Quick thermostat: target control gets its own row, readings no longer collide with it. */
#dashboardZones { grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr)); }
#dashboardZones, #dashboardDevices { align-items:start; }
.quick-thermostat-control { min-width:0; }
.quick-thermostat-control .thermostat-main {
grid-template-columns:minmax(0,1fr) minmax(0,1fr);
@@ -851,6 +852,8 @@ body.simulation-standalone [data-view="simulation"] { min-height:calc(100vh - 36
.quick-thermostat-control .zone-enable-toggle { flex:0 0 auto; }
.quick-thermostat-control .zone-state-line { gap:8px; font-size:10px; }
.quick-thermostat-control .zone-state-line span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quick-thermostat-control .control-owner-line { align-items:flex-start; flex-wrap:wrap; }
.quick-thermostat-control .control-owner-line span { overflow:visible; text-overflow:clip; white-space:normal; }
/* Smaller Node-RED/simulator-like plan blocks with explicit group context. */
#controlPlan.automation-plan-grid { grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr)); gap:8px; }
+1 -1
View File
@@ -1,4 +1,4 @@
const CACHE = 'gree-controller-v080-control-ownership';
const CACHE = 'gree-controller-v082-ui-i18n-ha-freshness';
const SCOPE = new URL(self.registration.scope).pathname.replace(/\/$/, '');
const path = value => `${SCOPE}${value.startsWith('/') ? value : `/${value}`}` || '/';
const ASSETS = [path('/'), path('/styles.css'), path('/app.js'), path('/theme-init.js'), path('/favicon.svg'), path('/manifest.webmanifest'), path('/lang/index.json'), path('/lang/en.json')];