Skip to content

Sensor widget fixes and improvements - #94

Merged
cryptomilk merged 7 commits into
mainfrom
asn-wip
Aug 8, 2026
Merged

Sensor widget fixes and improvements#94
cryptomilk merged 7 commits into
mainfrom
asn-wip

Conversation

@cryptomilk

Copy link
Copy Markdown
Owner

Sensor widget fixes and improvements

cryptomilk and others added 7 commits August 7, 2026 09:52
_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>
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Frontend Test Results

113 tests  ±0   113 ✅ ±0   0s ⏱️ ±0s
  4 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit bbdb4db. ± Comparison against base commit a46780d.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Python Test Results

1 158 tests  +28   1 158 ✅ +28   25s ⏱️ -1s
    1 suites ± 0       0 💤 ± 0 
    1 files   ± 0       0 ❌ ± 0 

Results for commit bbdb4db. ± Comparison against base commit a46780d.

@cryptomilk
cryptomilk merged commit 029f1fd into main Aug 8, 2026
10 checks passed
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