From 4f53aeecd905240d4972b14d0b0ba63fdff0d02f Mon Sep 17 00:00:00 2001 From: dArkjON Date: Fri, 27 Mar 2026 02:57:46 +0100 Subject: [PATCH 1/2] Add support for WYLDR16A1081 smart plug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add WYLDR16A1081 to the device map as a dedicated entry with a new VeSyncWYLDRPlug class. This device is functionally identical to the BSDOG01 series (on/off, real-time power, voltage, daily energy) but does not support energy history retrieval via the bypassV2 API — calls to getEnergyHistory return result code -1 for this device type. VeSyncWYLDRPlug overrides _get_energy_history() with a no-op so that weekly and monthly history requests are silently skipped instead of generating spurious warning logs on every poll cycle. --- src/pyvesync/device_map.py | 9 +++++++++ src/pyvesync/devices/vesyncoutlet.py | 25 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/pyvesync/device_map.py b/src/pyvesync/device_map.py index d467eb1..6ad6fbe 100644 --- a/src/pyvesync/device_map.py +++ b/src/pyvesync/device_map.py @@ -484,6 +484,15 @@ class ThermostatMap(DeviceMapTemplate): setup_entry='BSDOG01', device_alias='Smart Plug Series', ), + OutletMap( + dev_types=['WYLDR16A1081'], + class_name='VeSyncWYLDRPlug', + features=[OutletFeatures.ONOFF, OutletFeatures.ENERGY_MONITOR], + model_name='Smart Plug', + model_display='WYLDR Smart Plug', + setup_entry='WYLDR16A1081', + device_alias='WYLDR Smart Plug', + ), ] """List of ['OutletMap'][pyvesync.device_map.OutletMap] configuration objects for outlet devices.""" diff --git a/src/pyvesync/devices/vesyncoutlet.py b/src/pyvesync/devices/vesyncoutlet.py index 994d697..83ec3ec 100644 --- a/src/pyvesync/devices/vesyncoutlet.py +++ b/src/pyvesync/devices/vesyncoutlet.py @@ -989,6 +989,31 @@ async def toggle_switch(self, toggle: bool | None = None) -> bool: return True +class VeSyncWYLDRPlug(VeSyncBSDOGPlug): + """VeSync WYLDR16A1081 smart plug. + + Identical to VeSyncBSDOGPlug but does not support energy history + (weekly/monthly) via the bypassV2 API. Calls to getEnergyHistory + return result code -1 for this device type. + + Args: + details (ResponseDeviceDetailsModel): The device details. + manager (VeSync): The VeSync manager. + feature_map (OutletMap): The feature map for the device. + + """ + + __slots__ = () + + async def _get_energy_history(self, history_interval: str) -> None: + """Energy history is not supported by this device type.""" + logger.debug( + '%s (%s) does not support energy history retrieval', + self.device_name, + self.device_type, + ) + + class VeSyncESW10USA(BypassV2Mixin, VeSyncOutlet): """VeSync ESW10 USA outlet. From db4cb9d192b9a3c4b0b4dc4be104115975a9dd8a Mon Sep 17 00:00:00 2001 From: dArkjON Date: Fri, 27 Mar 2026 03:09:29 +0100 Subject: [PATCH 2/2] Fix unused argument lint warning in VeSyncWYLDRPlug --- src/pyvesync/devices/vesyncoutlet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyvesync/devices/vesyncoutlet.py b/src/pyvesync/devices/vesyncoutlet.py index 83ec3ec..b23a857 100644 --- a/src/pyvesync/devices/vesyncoutlet.py +++ b/src/pyvesync/devices/vesyncoutlet.py @@ -1005,7 +1005,7 @@ class VeSyncWYLDRPlug(VeSyncBSDOGPlug): __slots__ = () - async def _get_energy_history(self, history_interval: str) -> None: + async def _get_energy_history(self, _history_interval: str) -> None: """Energy history is not supported by this device type.""" logger.debug( '%s (%s) does not support energy history retrieval',