Skip to content

Commit c5c4bbf

Browse files
committed
Update Docs and Changelog
1 parent 8f18c22 commit c5c4bbf

3 files changed

Lines changed: 40 additions & 6 deletions

File tree

trmnl-ha/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Generic URL mode for capturing any website (not just Home Assistant)
13+
- PNG compression level control (`compression_level` parameter)
14+
- Manual black/white level adjustments with `levels_enabled` toggle
15+
- HA connection diagnostics banner with token preview and status
16+
- `?refresh=1` query param to force HA connection refresh
17+
818
## [0.3.2] - 2025-12-30
919

1020
### Changed

trmnl-ha/DOCS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ http://localhost:10000/?url=https://status.github.com&viewport=800x480
160160
| `dithering` | No | flag | Enable advanced dithering for e-ink |
161161
| `dither_method` | No | `floyd-steinberg`, `ordered`, `none` | Dithering algorithm (default: `floyd-steinberg`) |
162162
| `palette` | No | `bw`, `gray-4`, `gray-16`, `gray-256` | Color palette for dithering |
163+
| `compression_level` | No | `1-9` | PNG compression level (default: `9`, max compression) |
164+
| `levels_enabled` | No | flag | Enable manual black/white level adjustments |
165+
| `black_level` | No | `0-100` | Black point (requires `levels_enabled`) |
166+
| `white_level` | No | `0-100` | White point (requires `levels_enabled`) |
163167
| `format` | No | `png`, `jpeg`, `bmp` | Output format (default: `png`) |
164168
| `rotate` | No | `90`, `180`, `270` | Rotation in degrees |
165169
| `theme` | No | string | Home Assistant theme name (HA mode only) |
@@ -257,6 +261,16 @@ For best e-ink results:
257261
2. Check that the dashboard path is correct
258262
3. Increase the `wait` parameter if the dashboard has many dynamic elements
259263

264+
### HA Connection Issues
265+
266+
When Home Assistant is not connected, the Web UI displays a diagnostic banner showing:
267+
268+
- **Status**: Why the connection failed (e.g., "Network error", "401 Unauthorized")
269+
- **URL**: The configured Home Assistant URL
270+
- **Token**: First 4 characters of your token (masked) for verification
271+
272+
If the connection data seems stale, add `?refresh=1` to the URL to force a fresh connection attempt.
273+
260274
## Security Considerations
261275

262276
### Network Isolation

trmnl-ha/ha-trmnl/tests/unit/dithering.test.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,25 @@ describe('Dithering Module', () => {
3737
return
3838
}
3939
stdout.on('data', (chunk: Buffer) => chunks.push(chunk))
40-
stdout.on('end', () => { resolve(Buffer.concat(chunks)); })
40+
stdout.on('end', () => {
41+
resolve(Buffer.concat(chunks))
42+
})
4143
stdout.on('error', reject)
4244
})
4345
})
44-
})
46+
}, 15000)
4547

4648
// ==========================================================================
4749
// Constants - Test that module exports expected values
4850
// ==========================================================================
4951

5052
describe('SUPPORTED_METHODS', () => {
5153
it('exports array of supported dithering methods', () => {
52-
expect(SUPPORTED_METHODS).toEqual(['floyd-steinberg', 'ordered', 'threshold'])
54+
expect(SUPPORTED_METHODS).toEqual([
55+
'floyd-steinberg',
56+
'ordered',
57+
'threshold',
58+
])
5359
})
5460
})
5561

@@ -113,7 +119,9 @@ describe('Dithering Module', () => {
113119

114120
it('falls back to defaults when invalid method provided', () => {
115121
// NOTE: Intentionally testing with invalid input - type assertion required
116-
const result = validateDitheringOptions({ method: 'invalid-method' as DitheringMethod })
122+
const result = validateDitheringOptions({
123+
method: 'invalid-method' as DitheringMethod,
124+
})
117125
expect(result.method).toBe('floyd-steinberg')
118126
})
119127

@@ -406,11 +414,13 @@ describe('Dithering Module', () => {
406414
return
407415
}
408416
stdout.on('data', (chunk: Buffer) => chunks.push(chunk))
409-
stdout.on('end', () => { resolve(Buffer.concat(chunks)); })
417+
stdout.on('end', () => {
418+
resolve(Buffer.concat(chunks))
419+
})
410420
stdout.on('error', reject)
411421
})
412422
})
413-
})
423+
}, 15000)
414424

415425
it('produces 1-bit BW images under 50KB for 800x480', async () => {
416426
const result = await applyDithering(largeTestImage, {

0 commit comments

Comments
 (0)