Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oppo Plugin: Updates #953

Merged
merged 8 commits into from
Aug 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions oppo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,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_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, CONN_NET_TCP_CLI, CONN_SER_ASYNC, PLUGIN_ATTR_CMD_CLASS)
from lib.model.smartdeviceplugin import SmartDevicePlugin, Standalone
from lib.model.sdp.command import SDPCommandParseStr

CUSTOM_INPUT_NAME_COMMAND = 'custom_inputnames'

Expand All @@ -54,7 +55,7 @@ class oppo(SmartDevicePlugin):
The know-how is in the commands.py (and some DT_ classes...)
"""

PLUGIN_VERSION = '1.0.0'
PLUGIN_VERSION = '1.0.1'

def _set_device_defaults(self):

Expand All @@ -64,6 +65,8 @@ def _set_device_defaults(self):
elif PLUGIN_ATTR_SERIAL_PORT in self._parameters and self._parameters[PLUGIN_ATTR_SERIAL_PORT]:
self._parameters[PLUGIN_ATTR_CONNECTION] = CONN_SER_ASYNC

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
87 changes: 56 additions & 31 deletions oppo/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ plugin:
tester: Morg
state: develop
keywords: iot device
version: 1.0.0
version: 1.0.1
sh_minversion: '1.9.5.1'
py_minversion: '3.6'
sdp_minversion: '1.0.3'
multi_instance: false
restartable: true
classname: oppo
Expand Down Expand Up @@ -39,36 +40,6 @@ parameters:
de: Serieller Anschluss (z.B. /dev/ttyUSB0 oder COM1)
en: serial port (e.g. /dev/ttyUSB0 or COM1)

conn_type:
type: str
mandatory: false
valid_list:
- ''
- net_tcp_request
- net_tcp_client
- net_tcp_jsonrpc
- net_udp_server
- serial
- serial_async

description:
de: Verbindungstyp
en: connection type

command_class:
type: str
default: SDPCommandParseStr
valid_list:
- SDPCommand
- SDPCommandStr
- SDPCommandParseStr
- SDPCommandJSON
- SDPCommandViessmann

description:
de: Klasse für Verarbeitung von Kommandos
en: class for command processing

model:
type: str
mandatory: false
Expand Down Expand Up @@ -198,6 +169,60 @@ parameters:
de: Item-Pfad für das Standby-Item
en: item path for standby switch item

send_retries:
type: num
default: 0

description:
de: Anzahl Sendeversuche
en: number of sending retries
description_long:
de: 'Anzahl Sendeversuche\n
Kommt keine (passende) Antwort nach dem Senden
eines Commands zurück, wird das Kommando nochmals
gesendet, sofern der Wert über 0 liegt.
'
en: 'number of sending retries\n
If no (suiting) answer is received after sending
a command the command is resent as long as this
value is more than 0.
'

sendretry_cycle:
type: num
valid_min: 1
default: 1

description:
de: Pause zwischen Durchgängen von Sendeversuchen
en: wait time between sending retry rounds
description_long:
de: 'Pause zwischen Durchgängen von Sendeversuchen\n
Sind Send Retries aktiv, wird ein Scheduler erstellt,
der im angegebenen Sekundentakt Kommandos erneut sendet,
zu denen keine (passenden) Antworten erhalten wurden.
'
en: 'wait time between sending retry rounds\n
If send retries are active, a scheduler gets added
that resends commands in the given cycle value (in seconds)
where no (suiting) answer got received.
'

delay_initial_read:
type: num
default: 0

description:
de: Warte nach Verbindungsaufbau mit dem Abfragen von Werten
en: Wait after connection with querying values

resume_initial_read:
type: bool
defaul: false
description:
de: 'Bei resume vom Plugin erstmaliges Lesen erneut durchführen'
en: 'Repeat initial read on resume'


item_attributes:

Expand Down
Loading