Skip to content

Fix ESPHome fan preset deprecation warning#36

Open
EdenNelson wants to merge 1 commit into
tuct:mainfrom
EdenNelson:fix/esphome-fan-preset-deprecation
Open

Fix ESPHome fan preset deprecation warning#36
EdenNelson wants to merge 1 commit into
tuct:mainfrom
EdenNelson:fix/esphome-fan-preset-deprecation

Conversation

@EdenNelson
Copy link
Copy Markdown

Use the current ESPHome Fan entity API for supported preset modes instead of registering them directly on FanTraits.

This keeps the existing fan trait construction for speed, speed count, oscillation, and direction, while wiring Fan-owned preset modes back into returned traits so Home Assistant still sees the supported presets.

Fixes #35

Summary

  • Replace deprecated FanTraits::set_supported_preset_modes(...) usage with Fan::set_supported_preset_modes(...).
  • Wire Fan-owned preset modes into get_traits() with ESPHome's current wire_preset_modes_ pattern.
  • Remove the unused local preset-mode vector.

Validation

  • git diff --check passed.
  • Editor diagnostics reported no errors in the changed fan files.
  • ESPHome 2026.5.0 local compile passed with a temporary Core400S config using the local component.
  • ESPHome 2026.5.1 live build/install passed from EdenNelson/levoit@fix/esphome-fan-preset-deprecation.
  • Build log scan found no fan preset deprecation warning, compiler warning, or build error.
  • Core400S live smoke test passed: fan still exposes Manual, Sleep, and Auto presets, excludes Pet, and accepts Manual/Sleep/Auto preset changes.

Disclosure

This PR was prepared with GitHub Copilot/AI assistance and human-in-the-loop review. Live validation was performed by a human on a Core400S using air-purifier-office.yaml. The change is intended to be API-only and should not alter fan behavior.

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.

Fix ESPHome fan preset deprecation warning

1 participant