Skip to content

fix(smarthome): tidy deferred TP3 rule minors + close coverage gaps - #211

Merged
CallMeTechie merged 1 commit into
masterfrom
fix/smarthome-tp3-minors
Jul 1, 2026
Merged

fix(smarthome): tidy deferred TP3 rule minors + close coverage gaps#211
CallMeTechie merged 1 commit into
masterfrom
fix/smarthome-tp3-minors

Conversation

@CallMeTechie

Copy link
Copy Markdown
Owner

Cleanup of the deferred minors from the TP3 whole-branch review (#209), plus test coverage for previously-untested paths. No behavior change beyond the two UX fixes; no migration.

Fixed

  • 409 double-signal: rule-limit errors now show only the #shr-limit banner (early return) instead of banner and a redundant alert.
  • Client-side name cap: maxlength="20" on the rule-name input (all 3 themes) matches the server-side cap, avoiding a raw 400.
  • Single-source threshold: limitWarn now derives from deconzCapabilities.ruleLimit.warnAtGcRules (=38) instead of the duplicated × 4 > 150 magic numbers (behavior identical: warn at ≥38 GC rules).
  • Stale comment: cancelConditionsFrom comment corrected — daylight uses eq true/false and is binary-invertible/included; only button (numeric code) is excluded.

Tests (coverage gaps from the review)

  • daylight trigger translation → daylight eq false (sunset) + lastupdated dx
  • unknown_button_action rejection for an unsupported button action
  • deconzClient.deleteSchedule DELETEs /schedules/:id

Full smart-home suite: 88/88 green.

Deliberately left (not minor bugs)

No gateway selector (multi-gateway UI = feature; single-gateway deployment), firstId null-on-empty (defensive; deCONZ never returns that post-POST), xy colour edit-prefill (xy→hex is lossy), loadCount alert (pure polish).

🤖 Generated with Claude Code

- rule-limit 409 shows banner only (no double alert)
- rule-name maxlength=20 client-side (3 themes)
- limitWarn derives from deconzCapabilities.ruleLimit.warnAtGcRules (single source)
- correct cancelConditionsFrom comment (daylight is eq-invertible, included)
- tests: daylight trigger translation, unknown_button_action, deleteSchedule
@CallMeTechie
CallMeTechie merged commit 0cd64fc into master Jul 1, 2026
8 checks passed
@CallMeTechie
CallMeTechie deleted the fix/smarthome-tp3-minors branch July 1, 2026 11:09
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