Skip to content

fix: fallback floor icons + refactor battery section rendering#174

Merged
TheRealSimon42 merged 2 commits into
mainfrom
feature/port-pr-171-floor-icons-batteries
Apr 15, 2026
Merged

fix: fallback floor icons + refactor battery section rendering#174
TheRealSimon42 merged 2 commits into
mainfrom
feature/port-pr-171-floor-icons-batteries

Conversation

@TheRealSimon42

Copy link
Copy Markdown
Owner

Summary

Port of #171 (by @JensLorenz) onto current main, with fixes:

  • Floor icons fallback (Falsche Etagen-Icons #170): getFloorIcon() uses HA-native mdi:home-floor-N icons when a floor has no custom icon set. Added null-safety for floor lookups.
  • Battery view refactor: Extracted createBatterySection() helper to deduplicate the three identical section blocks.
  • Voltage filter retained: Jens' PR removed the voltage sensor filter — restored it to prevent incorrect threshold comparisons (3V ≠ 3%).

Closes #170
Supersedes #171

Test plan

  • npm run build — no errors/warnings
  • Codacy analysis (Biome, Trivy, ESLint 9) — 0 issues
  • Dashboard loads without errors (hard refresh)
  • Floor grouping shows correct fallback icons
  • Batteries view renders all three groups correctly
  • Voltage sensors correctly excluded from battery view

🤖 Generated with Claude Code

- Add getFloorIcon() with HA-native mdi:home-floor-N fallbacks for areas section
- Add null-safety for floor lookups (floor?.name, floor?.icon, floor?.level)
- Extract createBatterySection() helper to deduplicate battery view rendering
- Retain voltage sensor filter to prevent incorrect threshold comparisons

Closes #170

Co-Authored-By: Jens Lorenz <jens.github@gmx.de>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Apr 15, 2026

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
Security 1 high

View in Codacy

🟢 Metrics 9 complexity · 0 duplication

Metric Results
Complexity 9
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

Floor data can be undefined at runtime (deleted floor still referenced
by areas), but TS index signature types don't reflect this. Explicit
type annotation makes the optional chaining intentional and resolves
Codacy ErrorProne issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@TheRealSimon42 TheRealSimon42 merged commit ec9b7ee into main Apr 15, 2026
1 of 2 checks passed
TheRealSimon42 pushed a commit that referenced this pull request Apr 15, 2026
Corrects Co-Authored-By email so GitHub links the contribution
to @JensLorenz's profile (floor icon fallback + battery refactor).

See: #174, #171

Co-Authored-By: Jens Lorenz <2900362+JensLorenz@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
TheDave94 pushed a commit to TheDave94/oriel-dashboard that referenced this pull request May 21, 2026
Corrects Co-Authored-By email so GitHub links the contribution
to @JensLorenz's profile (floor icon fallback + battery refactor).

See: TheRealSimon42#174, TheRealSimon42#171

Co-Authored-By: Jens Lorenz <2900362+JensLorenz@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Falsche Etagen-Icons

1 participant