8000
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fixed per-field entity-domain prefix (sensor./switch.) for Home Assistant config forms #39
Home Assistant entity fields in the configuration forms should display a fixed, non-editable domain prefix (e.g. sensor., switch.) as a chip, so the user only types the entity id and cannot enter an inconsistent/invalid prefix.
This already exists for Energy Monitor and Energy Load History Provider via the sensorPrefix flag on ConfigSchemaForm, but it has two limitations:
It is hardcoded to sensor. — every entity field gets the same sensor. prefix.
It is not enabled everywhere — Forecast Provider, Energy Load Forecast Provider and Miner Controller currently render the full entity id as free text.
Problem
The single sensor. prefix cannot represent forms that mix entity domains. The clearest example is the Generic Socket (Home Assistant) mi
8000
ner controller, whose config mixes:
A global sensor. prefix would be wrong for entity_switch.
Proposed solution
Make the fixed prefix per-field instead of a single global sensor.: derive the entity domain for each field (e.g. from the field's default value such as switch.miner_socket → switch., or sensor.… → sensor.), falling back to sensor. when no hint is available.
Render that per-field prefix as the fixed chip, with the user typing only the entity id (object id) after it.
Enable the prefix on the remaining Home Assistant forms: Forecast Provider, Energy Load Forecast Provider and Miner Controller, for a consistent experience across all HA-based configuration forms.
Activity
feat(frontend): selectable Home Assistant entity-domain prefix (#39)
Merge pull request #40 from markoceri/fix/issue-39-ha-entity-prefix