From 4327da66bdd02d1b68e1b8c3a8fdea429432d870 Mon Sep 17 00:00:00 2001 From: kaburagisec <135169292+kaburagisec@users.noreply.github.com> Date: Sun, 4 Oct 2026 09:43:54 +0700 Subject: [PATCH] refactor(media2): Add deprecated `SetEQPreset` method for legacy compatibility --- onvif/services/media2.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/onvif/services/media2.py b/onvif/services/media2.py index 789ac9b..775589f 100644 --- a/onvif/services/media2.py +++ b/onvif/services/media2.py @@ -1,7 +1,7 @@ """Media2 service implementation.""" from onvif.operator import ONVIFOperator -from onvif.utils.service import ONVIFService +from onvif.utils.service import ONVIFService, deprecated from onvif.utils.wsdl import ONVIFWSDL @@ -39,8 +39,8 @@ def CreateProfile(self, Name, Configuration=None): A created profile created via this method may be deleted via the DeleteProfile method. Optionally Configurations can be assigned to the profile on creation. - For details regarding profile assignment check also the method - AddConfiguration. + + For details regarding profile assignment check also the method AddConfiguration. """ return self.operator.call( "CreateProfile", Name=Name, Configuration=Configuration @@ -286,6 +286,23 @@ def SetAudioDecoderConfiguration(self, Configuration): "SetAudioDecoderConfiguration", Configuration=Configuration ) + @deprecated( + "Use SetEQPresetConfiguration instead. See https://github.com/onvif/specs/pull/830" + ) + def SetEQPreset(self, Configuration): + """Set Audio EQPreset using the legacy ONVIF operation name. + + This operation is retained for compatibility with devices implementing the ONVIF + 25.12 operation name before it was renamed in later specifications. + + Compatible with ONVIF >=25.12 and <26.12. + """ + return self.operator.legacy_call( + "SetEQPreset", + "SetEQPresetConfiguration", + Configuration=Configuration, + ) + def SetEQPresetConfiguration(self, Configuration): """This command is to configure Audio EQPreset.""" return self.operator.call(