fix: fallback floor icons + refactor battery section rendering#174
Merged
Conversation
- 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>
5 tasks
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| Security | 1 high |
🟢 Metrics 9 complexity · 0 duplication
Metric Results Complexity 9 Duplication 0
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
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port of #171 (by @JensLorenz) onto current
main, with fixes:getFloorIcon()uses HA-nativemdi:home-floor-Nicons when a floor has no custom icon set. Added null-safety for floor lookups.createBatterySection()helper to deduplicate the three identical section blocks.Closes #170
Supersedes #171
Test plan
npm run build— no errors/warnings🤖 Generated with Claude Code