From 684a60f7cf6501b0d037badeba213c9b5de4058e Mon Sep 17 00:00:00 2001 From: Onkel Andy Date: Sat, 17 Aug 2024 11:19:12 +0200 Subject: [PATCH] lms plugin: autoset command class and connection --- lms/__init__.py | 9 +++++++-- lms/plugin.yaml | 24 +----------------------- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/lms/__init__.py b/lms/__init__.py index df32aad30..d31250d00 100755 --- a/lms/__init__.py +++ b/lms/__init__.py @@ -40,8 +40,9 @@ class SmartPluginWebIf(): else: builtins.SDP_standalone = False -from lib.model.sdp.globals import (CUSTOM_SEP, PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_RECURSIVE, PLUGIN_ATTR_CONN_TERMINATOR) +from lib.model.sdp.globals import (CUSTOM_SEP, PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_RECURSIVE, PLUGIN_ATTR_CMD_CLASS, PLUGIN_ATTR_CONNECTION, PLUGIN_ATTR_CONN_TERMINATOR) from lib.model.smartdeviceplugin import SmartDevicePlugin, Standalone +from lib.model.sdp.command import SDPCommandParseStr import urllib.parse @@ -49,7 +50,8 @@ class SmartPluginWebIf(): class lms(SmartDevicePlugin): """ Device class for Logitech Mediaserver/Squeezebox function. """ - PLUGIN_VERSION = '1.5.2' + PLUGIN_VERSION = '1.5.3' + MIN_SDP_VERSION = '1.0.3' def _set_device_defaults(self): self.custom_commands = 1 @@ -58,6 +60,9 @@ def _set_device_defaults(self): self._custom_patterns = {1: '(?:[0-9a-fA-F]{2}[-:]){5}[0-9a-fA-F]{2}', 2: '', 3: ''} self._use_callbacks = True self._parameters[PLUGIN_ATTR_RECURSIVE] = 1 + self._parameters[PLUGIN_ATTR_CMD_CLASS] = SDPCommandParseStr + self._parameters[PLUGIN_ATTR_CONNECTION] = 'net_tcp_client' + self._parameters['web_port'] = self.get_parameter_value('web_port') if self.get_parameter_value('web_host') == '': host = self._parameters.get(PLUGIN_ATTR_NET_HOST) diff --git a/lms/plugin.yaml b/lms/plugin.yaml index ae6004f07..9c0ad6fa5 100755 --- a/lms/plugin.yaml +++ b/lms/plugin.yaml @@ -6,7 +6,7 @@ plugin: tester: Morg state: develop keywords: iot device logitechmediaserver lms sdp av - version: 1.5.2 + version: 1.5.3 sh_minversion: '1.9.5' py_minversion: '3.7' multi_instance: false @@ -71,28 +71,6 @@ parameters: de: Port für CLI Netzwerkverbindung en: CLI network port - conn_type: - type: str - default: net_tcp_client - valid_list: - - '' - - net_tcp_client - - description: - de: Verbindungstyp - en: connection type - - command_class: - type: str - default: SDPCommandParseStr - valid_list: - - SDPCommand - - SDPCommandParseStr - - description: - de: Klasse für Verarbeitung von Kommandos - en: class for command processing - autoreconnect: type: bool default: true