Skip to content

feat(overview): five opt-in live header badges (power, unavailable count, now-playing, sun, updates)#271

Open
TheDave94 wants to merge 11 commits into
TheRealSimon42:mainfrom
TheDave94:grouped/live-overview-badges
Open

feat(overview): five opt-in live header badges (power, unavailable count, now-playing, sun, updates)#271
TheDave94 wants to merge 11 commits into
TheRealSimon42:mainfrom
TheDave94:grouped/live-overview-badges

Conversation

@TheDave94

Copy link
Copy Markdown

Summary

Adds five opt-in live badges to the overview header. Each is off by default, auto-hides when no relevant entity/state is present, and is configurable via the editor.

Badge What it shows Auto-hide trigger
Power live W/kW from a user-picked sensor (e.g. main grid) no power_badge_entity configured or entity missing
Unavailable count red badge with count of entities in state unavailable, respecting hidden/excluded labels count is 0
Now Playing green badge for the first media_player in playing state, tap → more-info nothing playing
Sun sunrise/sunset state for sun.sun with auto icon swap sun.sun entity missing
Updates orange badge with count of pending update.* entities, tap → /config/updates count is 0

Config

  • power_badge_entity?: string — pick a sensor to enable; auto-hide if absent
  • show_unavailable_alert_badge?: boolean — default false
  • show_now_playing_badge?: boolean — default false
  • show_sun_badge?: boolean — default false (auto-hide if no sun.sun)
  • show_updates_badge?: boolean — default false

All five are independently toggleable. The badge order in the header is person → power → unavailable → now-playing → sun → updates → custom.

Integrations / dependencies

  • Sun badge requires HA's built-in Sun integration (sun.sun entity). Auto-hides if absent.
  • Updates badge requires update.* entities (HA Core / HACS / Supervisor produce these automatically when integrations are installed).
  • Now-playing badge uses any media_player entity present.
  • Power badge requires the user to pick a power sensor — without that, the badge is simply not emitted.

Supersedes

This PR consolidates five individual feature PRs into a single review unit because they all add to the same badge array in OverviewViewStrategy.ts plus config fields and editor UI. Merging them one-by-one would have caused cascading conflicts.

Test plan

  • All toggles off → no extra badges in header
  • Each toggle on, with the relevant entity present → corresponding badge appears
  • Each toggle on, no relevant entity → badge auto-hides (no empty/error badges)
  • Multiple toggles on at once → badges appear in declared order
  • Tap actions work (sun → more-info, updates → /config/updates, now-playing → more-info)

AI-drafted under human supervision by @TheDave94. Tested live on Home Assistant — fully when the relevant hardware is available, otherwise only along the code paths that don't require an actual sensor of that type.

AutoCoder and others added 10 commits May 18, 2026 21:03
Adds power_badge_entity config field. When set to a sensor with
device_class 'power' or unit W/kW, a small badge appears in the
overview header (next to person chips) showing the current value.

Modular + auto-hide:
- Unset by default → no badge, no behaviour change
- Even when configured, the badge is dropped if the entity disappears
  from hass.states (renamed integration, etc.) — no broken badge
- Editor dropdown is itself hidden when no power-class sensors exist

Required integration: none. Works with any sensor reporting power
(grid power from energy integrations, smart-plug power readings,
inverter live output, etc.).

- types/strategy.ts: power_badge_entity?: string
- OverviewViewStrategy: inject power badge into the badges array
- StrategyEditor: _getPowerSensorEntities helper + dropdown under
  energy section (only rendered when sensors are available)
- en.json / de.json: descriptions

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an optional red badge in the overview header showing the count
of entities whose state is "unavailable". Useful for noticing broken
integrations, dead batteries, offline devices at a glance.

Modular + auto-hide:
- show_unavailable_alert_badge defaults to false → no surface area change
- Auto-hides at zero (count > 0 is the only render condition)
- Respects user-curated filters: no_dboard label, hidden_by, registry
  hidden flag — entities the user has chosen not to see don't inflate
  the count

Required integration: none.

- types/strategy.ts: show_unavailable_alert_badge?: boolean
- OverviewViewStrategy: count + badge injection
- StrategyEditor: checkbox under the section-order panel with description
- en.json / de.json: translations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a small green badge in the overview header showing the first
media_player.* entity whose state is 'playing'. Click opens the media
controls.

Modular + auto-hide:
- show_now_playing_badge defaults to false
- Badge only renders when at least one media_player is actively playing;
  auto-hides when paused / idle / off / unavailable

Required integration: none — uses the HA-native media_player domain.

- types/strategy.ts: show_now_playing_badge?: boolean
- OverviewViewStrategy: badge injection
- StrategyEditor: checkbox under the section-order panel
- en.json / de.json: translations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds an optional badge for sun.sun in the overview header. Icon flips
between sunset-down (sun up) and sunset-up (sun down); tap opens
more-info with the next sunrise/sunset.

Modular + auto-hide:
- show_sun_badge defaults to false
- Badge auto-hides if sun.sun entity isn't present

Required integration: the HA-bundled sun integration (active by default).

- types/strategy.ts: show_sun_badge?: boolean
- OverviewViewStrategy: badge injection
- StrategyEditor: checkbox under section-order panel
- en.json / de.json: translations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds show_updates_badge config (default false). When enabled, a small
orange badge in the overview header shows the count of update.*
entities in state 'on'. Tap navigates to Settings → Updates.

Modular + auto-hide:
- Default false → no surface area change
- Auto-hides at zero pending updates
- Mirrors PR TheRealSimon42#260 (maintenance section) for users who prefer a header
  badge over a whole section, or want both at once

Required integration: none — update.* is HA-native.

- types/strategy.ts: show_updates_badge?: boolean
- OverviewViewStrategy: count visible update.* entities, inject badge
- StrategyEditor: checkbox under section-order panel
- en.json / de.json: translations

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	src/translations/de.json
#	src/translations/en.json
#	src/types/strategy.ts
#	src/views/OverviewViewStrategy.ts
# Conflicts:
#	src/editor/StrategyEditor.ts
#	src/translations/de.json
#	src/translations/en.json
#	src/types/strategy.ts
#	src/views/OverviewViewStrategy.ts
# Conflicts:
#	src/editor/StrategyEditor.ts
#	src/translations/de.json
#	src/translations/en.json
#	src/types/strategy.ts
#	src/views/OverviewViewStrategy.ts
# Conflicts:
#	src/editor/StrategyEditor.ts
#	src/translations/de.json
#	src/translations/en.json
#	src/types/strategy.ts
#	src/views/OverviewViewStrategy.ts
@codacy-production

codacy-production Bot commented May 19, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · 0 duplication

Metric Results
Complexity 11
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

TheDave94 pushed a commit to TheDave94/oriel-dashboard that referenced this pull request May 20, 2026
Brings into main the remaining open PRs that weren't part of the prior
consolidation (bb43b04):

Improvement PRs (8 — real content):
- TheRealSimon42#277 chore(ci): translation lint guard
- TheRealSimon42#278 test: section-builder + entity-filter unit tests + snapshots
- TheRealSimon42#279 feat(rooms): auto-detect humidifier/valve/water_heater
- TheRealSimon42#280 feat(editor): derive target_section dropdown from section meta
- TheRealSimon42#281 fix(areas): auto-hide section + audit test
- TheRealSimon42#282 feat(editor): wire show_window_contacts_in_rooms + show_door_contacts_in_rooms
- TheRealSimon42#283 feat: custom_sections — user-declared sections without forking
- TheRealSimon42#284 chore(ci): release-please + release-build + ESLint enforcement

Grouped PRs (7 — content already in main via bb43b04 consolidation;
recorded with `-s ours` so the merges land in history without
duplicate/regressive edits):
- TheRealSimon42#270 grouped/optional-overview-sections
- TheRealSimon42#271 grouped/live-overview-badges
- TheRealSimon42#272 grouped/battery-view-improvements
- TheRealSimon42#273 grouped/room-view-features
- TheRealSimon42#274 grouped/section-meta-security
- TheRealSimon42#275 grouped/covers-weather
- TheRealSimon42#276 grouped/persons-overview-tweaks

CI fixes uncovered during merge:
- Bump Node 20 → 22 in validate.yml + release-build.yml (ESLint 10 requires Node 22+)
- Load eslint-plugin-security (rules off) so source-level Codacy
  disable directives resolve cleanly
- Drop unused PropertyValues import in StrategyEditor.ts

Version 1.3.4-thedave-r2 → 1.4.0-thedave (minor bump: feat: custom_sections,
auto-detect humidifier/valve, editor coverage, release automation).

Dist rebuilt + tests + ESLint pass (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TheDave94 TheDave94 closed this May 20, 2026
@TheDave94 TheDave94 deleted the grouped/live-overview-badges branch May 20, 2026 22:44
@TheDave94 TheDave94 restored the grouped/live-overview-badges branch May 21, 2026 08:55
@TheDave94 TheDave94 reopened this May 21, 2026
@TheDave94

TheDave94 commented May 21, 2026

Copy link
Copy Markdown
Author

My main focus has shifted to a downstream project (Oriel Dashboard) — built on what simon42 established, taken in its own direction — but the work in this PR was always meant for simon42 and I'm happy to keep iterating on it here. Address review feedback, split bundled changes into smaller pieces, whatever helps the review. Just ping me.

TheDave94 pushed a commit to TheDave94/oriel-dashboard that referenced this pull request May 21, 2026
Brings into main the remaining open PRs that weren't part of the prior
consolidation (ee9c67c):

Improvement PRs (8 — real content):
- TheRealSimon42#277 chore(ci): translation lint guard
- TheRealSimon42#278 test: section-builder + entity-filter unit tests + snapshots
- TheRealSimon42#279 feat(rooms): auto-detect humidifier/valve/water_heater
- TheRealSimon42#280 feat(editor): derive target_section dropdown from section meta
- TheRealSimon42#281 fix(areas): auto-hide section + audit test
- TheRealSimon42#282 feat(editor): wire show_window_contacts_in_rooms + show_door_contacts_in_rooms
- TheRealSimon42#283 feat: custom_sections — user-declared sections without forking
- TheRealSimon42#284 chore(ci): release-please + release-build + ESLint enforcement

Grouped PRs (7 — content already in main via ee9c67c consolidation;
recorded with `-s ours` so the merges land in history without
duplicate/regressive edits):
- TheRealSimon42#270 grouped/optional-overview-sections
- TheRealSimon42#271 grouped/live-overview-badges
- TheRealSimon42#272 grouped/battery-view-improvements
- TheRealSimon42#273 grouped/room-view-features
- TheRealSimon42#274 grouped/section-meta-security
- TheRealSimon42#275 grouped/covers-weather
- TheRealSimon42#276 grouped/persons-overview-tweaks

CI fixes uncovered during merge:
- Bump Node 20 → 22 in validate.yml + release-build.yml (ESLint 10 requires Node 22+)
- Load eslint-plugin-security (rules off) so source-level Codacy
  disable directives resolve cleanly
- Drop unused PropertyValues import in StrategyEditor.ts

Version 1.3.4-thedave-r2 → 1.4.0-thedave (minor bump: feat: custom_sections,
auto-detect humidifier/valve, editor coverage, release automation).

Dist rebuilt + tests + ESLint pass (0 errors, 0 warnings).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@TheDave94 TheDave94 closed this May 22, 2026
@TheDave94 TheDave94 deleted the grouped/live-overview-badges branch May 22, 2026 05:55
@TheDave94 TheDave94 restored the grouped/live-overview-badges branch May 23, 2026 20:43
@TheDave94 TheDave94 reopened this May 23, 2026
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.

1 participant