From 626deafe506bbd46578c1df4e1b78abc0f03dee6 Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Sat, 17 Aug 2024 10:50:14 +0200 Subject: [PATCH] denon plugin: auto set command class --- denon/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/denon/__init__.py b/denon/__init__.py index 86ebafaa0..ae1cfe675 100755 --- a/denon/__init__.py +++ b/denon/__init__.py @@ -41,8 +41,9 @@ class SmartPluginWebIf(): else: builtins.SDP_standalone = False -from lib.model.sdp.globals import (PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_CONNECTION, PLUGIN_ATTR_SERIAL_PORT, PLUGIN_ATTR_CONN_TERMINATOR, CONN_NULL, CONN_NET_TCP_CLI, CONN_SER_ASYNC) +from lib.model.sdp.globals import (PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_CONNECTION, PLUGIN_ATTR_SERIAL_PORT, PLUGIN_ATTR_CONN_TERMINATOR, PLUGIN_ATTR_CMD_CLASS, CONN_NULL, CONN_NET_TCP_CLI, CONN_SER_ASYNC) from lib.model.smartdeviceplugin import SmartDevicePlugin, Standalone +from lib.model.sdp.command import SDPCommandParseStr # from .webif import WebInterface @@ -73,6 +74,8 @@ def _set_device_defaults(self): self.logger.error('Neither host nor serialport set, connection not possible. Using dummy connection, plugin will not work') self._parameters[PLUGIN_ATTR_CONNECTION] = CONN_NULL + self._parameters[PLUGIN_ATTR_CMD_CLASS] = SDPCommandParseStr + b = self._parameters[PLUGIN_ATTR_CONN_TERMINATOR].encode() b = b.decode('unicode-escape').encode() self._parameters[PLUGIN_ATTR_CONN_TERMINATOR] = b