Skip to content

fix: use probatio schemas on Home Assistant 2026.10 and later - #159

Merged
bvweerd merged 1 commit into
devfrom
claude/vibrant-dijkstra-pckmow
Oct 6, 2026
Merged

bvweerd merged 1 commit into
devfrom
claude/vibrant-dijkstra-pckmow

Conversation

@bvweerd

@bvweerd bvweerd commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Problem

The Lint & pre-commit job is red on dev (scheduled run of 2026-10-05) and on every pull request. Home Assistant 2026.10 replaced voluptuous with probatio and now types async_show_form(data_schema=...) as probatio.Schema:

config_flow.py:91: error: Argument "data_schema" to "async_show_form" of "ConfigFlow" has incompatible type "voluptuous.schema_builder.Schema"; expected "probatio.schema.Schema | None"  [arg-type]

(6×). voluptuous is also no longer a Home Assistant dependency; it is only still installed through other packages.

Change

  • __init__.py and config_flow.py import probatio as vol on Home Assistant ≥ 2026.10 and voluptuous before that. The choice goes by version (MAJOR_VERSION/MINOR_VERSION), not by whether probatio imports: 2026.9 already installs probatio but still expects voluptuous schemas.
  • The pre-commit mypy hook types against the latest stable Home Assistant (2026.9.4). The standalone mypy step types against the release pytest-homeassistant-custom-component pins (2026.10.0b0). The two config flow schema variables are therefore annotated Any, so neither run needs an ignore.

Validation

  • Standalone mypy on Python 3.14 / Home Assistant 2026.10.0b0: no issues (6 errors before)
  • pre-commit run --all-files (hook on Home Assistant 2026.9.4): passes
  • pytest: 95 passed on Python 3.14 / Home Assistant 2026.10.0b0 (probatio path) and on Python 3.13 / Home Assistant 2026.2.3 (voluptuous path)

🤖 Generated with Claude Code

https://claude.ai/code/session_012VjGcBURcFQJMzcFaFvciV


Generated by Claude Code

Home Assistant 2026.10 replaced voluptuous with probatio and now types
async_show_form's data_schema as probatio.Schema, so the lint job's mypy
step fails on dev (scheduled run of 2026-10-05) and on every pull request.
voluptuous is also no longer a Home Assistant dependency.

Import probatio as vol from 2026.10 on and voluptuous before that. The
choice goes by version, not by whether probatio imports: 2026.9 already
installs probatio but still expects voluptuous schemas.

The pre-commit mypy hook types against the latest stable release (2026.9)
and the lint job against the one pytest-homeassistant-custom-component
pins (2026.10), so the two config flow schemas are annotated Any.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012VjGcBURcFQJMzcFaFvciV
@bvweerd
bvweerd merged commit 3c060c7 into dev Oct 6, 2026
@bvweerd
bvweerd deleted the claude/vibrant-dijkstra-pckmow branch October 6, 2026 06:23
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.

2 participants