Skip to content

feat: add support for Levoit Vital Pet air purifier (LAP-P201S-WUS) - #535

Open
bryanhong wants to merge 3 commits into
webdjoe:devfrom
bryanhong:add-levoit-vital-pet-lap-p201s
Open

feat: add support for Levoit Vital Pet air purifier (LAP-P201S-WUS)#535
bryanhong wants to merge 3 commits into
webdjoe:devfrom
bryanhong:add-levoit-vital-pet-lap-p201s

Conversation

@bryanhong

Copy link
Copy Markdown

Add support for Levoit Vital Pet air purifier (LAP-P201S-WUS)

Adds the Levoit Vital Pet (LAP-P201S-WUS) to the purifier device map. All behavior below was validated against real hardware (US region) — mode strings were probed via setPurifierMode bypassV2 calls and confirmed by observing the device and the VeSync app.

Changes

  • device_map.py — new PurifierMap entry: VeSyncAirBaseV2, 3 fan levels, AIR_QUALITY feature, modes sleep / manual / odorShieldQuiet / odorShieldBalanced / odorShieldPerformance, setup entry LAP-P201S, alias "Vital Pet".
  • const.py — new PurifierModes members ODOR_SHIELD_QUIET, ODOR_SHIELD_BALANCED, ODOR_SHIELD_PERFORMANCE. These are the device's "Auto" mode family: the app presents Auto with a Quiet/Balanced/Performance preference, and each preference is a distinct workMode. (odorShieldPlus/autoPlus spellings were probed and rejected by the API — the app's "Plus" appears to be a separate toggle, not a work mode.)
  • models/purifier_models.py — made lightDetectionSwitch, environmentLightState, efficientModeTimeRemain optional (this device omits them) and added fields it returns: VOC, odorLevel, buzzerSwitch, filterRemainDay, resetFilterDate, cumulativeCleanAir, totalCleanAir, errorCodes, screen/child-lock preference objects.
  • devices/vesyncpurifier.pyset_mode() now matches requested modes case-insensitively against the device's mode list before sending. Previously it lowercased camelCase modes (odorshieldbalanced), which the API rejects; this fixes mode setting for any camelCase mode while preserving validation.

Testing

  • Probed accepted/rejected workMode strings on hardware; only the three odorShield modes + sleep + manual are accepted.
  • Round-trip verified from Home Assistant (custom component running this branch): mode changes, fan levels 1–3, display/child-lock switches, air-quality/PM2.5/filter sensors all track the VeSync app.

Status

Draft while the device soak-tests in a live Home Assistant install for a few more days; will mark ready for review after that.

bryanhong and others added 3 commits July 23, 2026 21:46
- Add device_map entry: VeSyncAirBaseV2, modes sleep/manual/odorShieldBalanced,
  fan levels 1-3, air quality feature (no light detection on this model)
- Add PurifierModes.ODOR_SHIELD_BALANCED ('odorShieldBalanced')
- Make lightDetectionSwitch/environmentLightState/efficientModeTimeRemain
  optional in PurifierVitalDetailsResult (Vital Pet omits them) and add the
  model's additional fields (VOC, odorLevel, buzzerSwitch, filter day counters,
  screen/child-lock preference sub-models)
- Wire VOC into purifier state when present
- Fix case-sensitive mode matching in set_mode (VeSyncAirBypass/VeSyncAirBaseV2):
  mode.lower() could never match camelCase mode values like odorShieldBalanced

All changes verified against physical hardware (LAP-P201S-WUS, US firmware):
discovery, full state parse, fan speed set/restore, mode set/restore, display toggle.
@bryanhong bryanhong changed the title Add support for Levoit Vital Pet air purifier (LAP-P201S-WUS) feat: add support for Levoit Vital Pet air purifier (LAP-P201S-WUS) Jul 24, 2026
@bryanhong
bryanhong marked this pull request as ready for review July 29, 2026 04:53
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