Skip to content

Commit

Permalink
denon plugin: auto set command class
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Aug 17, 2024
1 parent 9befb9f commit 626deaf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion denon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 626deaf

Please sign in to comment.