diff --git a/denonavr/api.py b/denonavr/api.py index 3c57a80..4a27acf 100644 --- a/denonavr/api.py +++ b/denonavr/api.py @@ -604,6 +604,8 @@ def register_callback( if event not in self._callbacks.keys(): self._callbacks[event] = [] + elif callback in self._callbacks[event]: + return self._callbacks[event].append(callback) def unregister_callback( @@ -618,6 +620,8 @@ def _register_raw_callback( self, callback: Callable[[str], Awaitable[None]] ) -> None: """Register a callback handler for raw telnet messages.""" + if callback in self._raw_callbacks: + return self._raw_callbacks.append(callback) def _unregister_raw_callback(