Skip to content

fix: unify state logic, fix lost/travelling zones, accept both spellings#41

Open
genebean wants to merge 1 commit into
malcolmrigg:masterfrom
genebean:pr/bug-fixes
Open

fix: unify state logic, fix lost/travelling zones, accept both spellings#41
genebean wants to merge 1 commit into
malcolmrigg:masterfrom
genebean:pr/bug-fixes

Conversation

@genebean

@genebean genebean commented Jun 5, 2026

Copy link
Copy Markdown

I really like this card but the bugs were bothering me so I got Claude Code to help me make things better. This is the second of a set of 3 PRs that when combined are what I am now using at home. The first one is #40

  • Make getWizardState() the single source of truth: it now accepts a full wizard config object so it can check proximity_sensor; set hass populates a _wizardStates cache and drawTime reads from it instead of reimplementing state logic independently (which caused divergence and broke permanent locations)
  • Remove pre-adding of lost/travelling zones: they now only appear on the dial when a wizard is actually in that state
  • Remove the && this.config.travelling gate on travelling detection: moving by velocity or proximity sensor triggers Travelling regardless of whether the custom text key is set
  • Proximity sensor check moved into getWizardState so both zone-building (set hass) and hand-positioning (drawTime) use the same decision
  • Accept both 'travelling' and 'traveling' (American spelling) in config
  • Accept both 'fontName' and 'fontname' spellings in config
  • Default lostState to "Lost", travellingState to "Travelling" (was "Away")
  • Reduce wizardOffset spread factor from 0.6 to 0.3 so hands center more accurately on their zone label

- Make getWizardState() the single source of truth: it now accepts a full
  wizard config object so it can check proximity_sensor; set hass populates
  a _wizardStates cache and drawTime reads from it instead of reimplementing
  state logic independently (which caused divergence and broke permanent
  locations)
- Remove pre-adding of lost/travelling zones: they now only appear on the
  dial when a wizard is actually in that state
- Remove the && this.config.travelling gate on travelling detection: moving
  by velocity or proximity sensor triggers Travelling regardless of whether
  the custom text key is set
- Proximity sensor check moved into getWizardState so both zone-building
  (set hass) and hand-positioning (drawTime) use the same decision
- Accept both 'travelling' and 'traveling' (American spelling) in config
- Accept both 'fontName' and 'fontname' spellings in config
- Default lostState to "Lost", travellingState to "Travelling" (was "Away")
- Reduce wizardOffset spread factor from 0.6 to 0.3 so hands center more
  accurately on their zone label

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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