feat: Add support for Sagewe F3s202-USVC smart plug#533
Open
jasonjhofmann wants to merge 1 commit into
Open
Conversation
Register the Sagewe 15A Wi-Fi Smart Outlet Plug with Energy Monitoring (deviceType F3s202-USVC, configModule SG_WFBO_OTL_F3s202-USVC_US) under the existing WHOGPLUG OutletMap entry. Verified against the live API with physical devices: the plug speaks the full WHOGPLUG bypassV2 dialect — getOutletStatus returns enabled/voltage/power/current/energy, setSwitch toggles with clean state readback, and energy history works for weekly/monthly (getEnergyHistory) and yearly (getELECConsumePerMonthLastYear). The BSDOG getProperty dialect returns inner result code -1 for this device, confirming VeSyncOutletWHOGPlug is the correct class. No test changes needed: fixtures and parametrization key on setup_entry, and call_json uses dev_types[0], so the appended dev type reuses the existing WHOGPLUG coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RzgVNa9W9icsjQZcmRu9J9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds the Sagewe 15A Wi-Fi Smart Outlet Plug with Energy Monitoring (sold under the Sagewe brand, pairs via the VeSync app) to the device map:
deviceType:F3s202-USVCconfigModule:SG_WFBO_OTL_F3s202-USVC_USvsotIt is registered under the existing
WHOGPLUGOutletMapentry — no new class needed.Why the WHOGPLUG class is correct (verified against the live API)
Probed a physical plug with both whitelabel bypassV2 dialects:
getPropertyreturns inner result code-1(unsupported).getOutletStatus→{"enabled": false, "voltage": 124.02, "energy": 0, "power": 0, "current": 0}setSwitch {"id": 0, "enabled": true}→ code 0, state reads backenabled: truewith live load telemetry (power: 86.8,current": 0.70); off round-trip cleangetEnergyHistory(weekly + monthly) → populatedenergyInfosday bucketsgetELECConsumePerMonthLastYear(yearly) → 12 populated month bucketsSo the plug supports everything the
WHOGPLUGentry claims, includingENERGY_HISTORY.Tested with 21 physical units on one account; also running in Home Assistant (2026.7.2 stock
vesyncintegration with this dev type patched into the device map) — switch + voltage/power/energy entities all work.Changes
src/pyvesync/device_map.py— appendF3s202-USVCto theWHOGPLUGentry'sdev_typesREADME.md,docs/supported_devices.md— list the deviceNo test changes: fixtures (
src/tests/api/vesyncoutlet/WHOGPLUG.yaml) and parametrization key onsetup_entry, andcall_jsonusesdev_types[0], so the appended type reuses existing WHOGPLUG coverage.Testing
pytest src/tests/→ 380 passed, 3 skipped on this branch🤖 Generated with Claude Code
https://claude.ai/code/session_01RzgVNa9W9icsjQZcmRu9J9