Skip to content

Commit

Permalink
lms plugin: autoset command class and connection
Browse files Browse the repository at this point in the history
  • Loading branch information
onkelandy committed Aug 17, 2024
1 parent 801a455 commit 684a60f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
9 changes: 7 additions & 2 deletions lms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,18 @@ 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


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
Expand All @@ -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)
Expand Down
24 changes: 1 addition & 23 deletions lms/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 684a60f

Please sign in to comment.