Sensor widget fixes and improvements - #94
Merged
Merged
Conversation
_normalize_entities() built the primary entity descriptor without a "name" key when the widget used the flat entity= key (as opposed to the entities=[...] list). The header picked up the widget-level name via a **widget spread, but _legend_geometry() only reads name from the entity descriptor, so a name override on the first entity never reached the legend. Fixes #88 (first item) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
_legend_geometry() laid out entries left to right with no width cap, so long friendly names overflowed the graph area and overlapped adjacent legend entries. It now measures the combined entry width against the available graph width and, when it doesn't fit, splits that width evenly across entries and truncates each name with an ellipsis. Fixes #88 (sixth item) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The secondary Y-axis always auto-scaled to the secondary-axis entities' data range, with no way to pin it the way the primary axis already supports via upper_bound/lower_bound. Add matching secondary_upper_bound/secondary_lower_bound config keys, threaded through to the same _y_bounds() helper used for the primary axis. Addresses #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Legend visibility was tied solely to entity count (shown whenever more than one entity was configured), so there was no way to keep axis labels while hiding the per-entity legend. Add a show_legend config key (default true) that gates the legend independently of show_labels/show_name. Addresses #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The header's value/unit font size was always auto-derived from the row height with no way to make it larger or smaller independently. Add a state_font_size config key that overrides value_font_sz and unit_font_sz after header layout, recomputing unit_x so the unit text stays glued to the resized value text instead of overlapping. Addresses #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The header always showed only the first entity's current state even when 2-3 entities were overlaid on the graph, hiding useful context about the other series. When show_state is enabled and more than one entity is configured, concatenate each entity's formatted state and unit with " / " via the new _combined_state_text() helper. Addresses #88 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The graph window could only be a rolling hours_to_show range relative
to the latest data point, with no way to pin it to a fixed time of
day (e.g. show only today from midnight). Add a start_time config
key ("HH:MM") resolved via the new _resolve_start_cutoff() helper
(today's date, per datetime.now(), combined with the parsed time),
threaded through _extract_entity_points() as a start_cutoff override
that replaces the rolling hours_to_show window when set.
Addresses #88
Co-Authored-By: Claude Opus 4.6 <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.
Sensor widget fixes and improvements