Skip to content

Commit 64d4778

Browse files
committed
fix: clean up debug logging from area fetch investigation
1 parent cbfff38 commit 64d4778

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

src/webServer.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,9 +425,6 @@ class WebServer {
425425
}
426426

427427
async _handleGetAreas(_req, res) {
428-
const _tokenPresent = !!process.env.SUPERVISOR_TOKEN;
429-
const _tokenLen = (process.env.SUPERVISOR_TOKEN || '').length;
430-
this.logger.info(`Areas endpoint called. Token present: ${_tokenPresent}, length: ${_tokenLen}`);
431428
// Collect areas from label file
432429
const labelAreas = new Set();
433430
if (this.labelLoader) {
@@ -443,9 +440,6 @@ class WebServer {
443440
// Fetch areas from Home Assistant Supervisor API (cached 30s)
444441
let haAreas = [];
445442
const supervisorToken = process.env.SUPERVISOR_TOKEN;
446-
if (!supervisorToken) {
447-
this.logger.warn('SUPERVISOR_TOKEN not available; skipping HA area fetch');
448-
}
449443
if (supervisorToken) {
450444
const now = Date.now();
451445
if (this._haAreasCache && now - this._haAreasCacheTime < 30000) {
@@ -468,7 +462,7 @@ class WebServer {
468462
let body = '';
469463
resp.on('data', (chunk) => { body += chunk; });
470464
resp.on('end', () => {
471-
this.logger.info(`Area API HTTP ${resp.statusCode}, body length: ${body.length}, preview: ${body.slice(0, 300)}`);
465+
this.logger.debug(`Area API HTTP ${resp.statusCode}, body length: ${body.length}`);
472466
try { resolve(JSON.parse(body)); } catch { resolve(null); }
473467
});
474468
});
@@ -477,7 +471,7 @@ class WebServer {
477471
req.write(postBody);
478472
req.end();
479473
});
480-
this.logger.info(`Area template response: type=${typeof data}, isArray=${Array.isArray(data)}, length=${Array.isArray(data) ? data.length : 'n/a'}`);
474+
this.logger.debug(`Area template response: isArray=${Array.isArray(data)}, count=${Array.isArray(data) ? data.length : 0}`);
481475
if (Array.isArray(data)) {
482476
for (const name of data) {
483477
if (typeof name === 'string' && name) {

0 commit comments

Comments
 (0)