Skip to content

Conversation

@omachala
Copy link
Owner

@omachala omachala commented Jan 4, 2026

Summary

Entity Config Format

entities:
  - sensor.power_*                      # string with wildcard
  - sensor.temperature                  # plain string
  - entity: sensor.special              # HA EntityConfig format
    name: "Custom Label"                # overrides friendly_name
    icon: mdi:flash                     # overrides entity icon

Auto-entities Integration

type: custom:auto-entities
card:
  type: custom:treemap-card
  filter:
    above: 10
filter:
  include:
    - label: power
    - area: Kitchen

Accept both string[] and EntityConfig[] formats for entities config:
- "sensor.power_*" (string with wildcard)
- { entity: "sensor.x", name: "Y" } (HA standard format)

This enables auto-entities compatibility and follows HA conventions.
Uses official EntityConfig from custom-card-helpers package.

Closes #24
@changeset-bot
Copy link

changeset-bot bot commented Jan 4, 2026

🦋 Changeset detected

Latest commit: e1870a4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ha-treemap-card Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Ondrej Machala added 5 commits January 4, 2026 20:23
- name: overrides friendly_name for label
- icon: overrides entity's default icon

This enables full HA EntityConfig support, not just format compatibility.
Users can now customize labels and icons per-entity.
- Add auto-entities mention in "Why Treemap Card?" section
- New "Auto-Entities Integration" section with examples
- Update Data Source table with EntityConfig format
- Add note to Order & Filter about entity-level filtering
- Replace manual CustomEvent with fireEvent helper
- Replace manual setTimeout debounce with debounce helper
- Removed ~15 lines of boilerplate code
@omachala omachala mentioned this pull request Jan 4, 2026
Ondrej Machala added 3 commits January 4, 2026 20:45
- Editor properly extracts entity IDs from auto-entities format
- Previously displayed [object Object] for EntityConfig objects
- Added 2 tests for EntityConfig and mixed format display
@omachala omachala force-pushed the feat/entity-config-support branch from c636e72 to 71e1386 Compare January 4, 2026 22:12
- Created docs/auto-entities-guide.md with full examples
- Simplified main README to brief mention with link
- Power users can find detailed YAML examples in guide
@omachala omachala force-pushed the feat/entity-config-support branch from 71e1386 to 97cb4e2 Compare January 4, 2026 22:17
Ondrej Machala added 2 commits January 4, 2026 22:21
Previously icon.icon always won. Now: entity icon > global icon.icon
Cleaner approach - all entity data stays together:
- _normalizeEntity now returns { entity, name?, icon? }
- No need to re-extract overrides from original input
@omachala omachala merged commit acba155 into main Jan 4, 2026
5 checks passed
@omachala omachala deleted the feat/entity-config-support branch January 4, 2026 22:33
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.

Feature Request: Advanced Entity Filtering (HA Labels & Templates) similar to Auto-Entities Outros tipos de filtros

2 participants