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

Pioneer Plugin: update to latest version for SDP including resend feature #954

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 pioneer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ class SmartPluginWebIf():
BASE = os.path.sep.join(os.path.realpath(__file__).split(os.path.sep)[:-3])
sys.path.insert(0, BASE)

from lib.model.sdp.globals import (PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_CONNECTION,
from lib.model.sdp.globals import (PLUGIN_ATTR_NET_HOST, PLUGIN_ATTR_CONNECTION, PLUGIN_ATTR_CMD_CLASS,
PLUGIN_ATTR_SERIAL_PORT, PLUGIN_ATTR_CONN_TERMINATOR,
PLUGIN_ATTR_MODEL, CONN_NET_TCP_CLI, CONN_SER_ASYNC, CONN_NULL)
from lib.model.smartdeviceplugin import SmartDevicePlugin, Standalone
from lib.model.sdp.command import SDPCommandParseStr

# from .webif import WebInterface

Expand All @@ -50,7 +51,7 @@ class SmartPluginWebIf():
class pioneer(SmartDevicePlugin):
""" Device class for Pioneer AV function. """

PLUGIN_VERSION = '1.0.2'
PLUGIN_VERSION = '1.0.3'

def _set_device_defaults(self):
# set our own preferences concerning connections
Expand All @@ -62,6 +63,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
2 changes: 1 addition & 1 deletion pioneer/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'dimmer': {'read': True, 'write': True, 'write_cmd': '{RAW_VALUE}SAA', 'cmd_settings': {'force_min': 0, 'force_max': 3}, 'item_type': 'num', 'dev_datatype': 'str', 'reply_pattern': r'SAA(\d)', 'item_attrs': {'attributes': {'remark': '0 = very bright, 1 = bright, 2 = dark, 3 = off'}}},
'sleep': {'read': True, 'write': True, 'read_cmd': '?SAB', 'write_cmd': '{VALUE}SAB', 'item_type': 'num', 'dev_datatype': 'PioSleep', 'reply_pattern': r'SAB(\d{3})', 'item_attrs': {'attributes': {'remark': '0 = off, 30 = 30 minutes, 60 = 60 minutes, 90 = 90 minutes'}}},
'amp': {'read': True, 'write': True, 'read_cmd': '?SAC', 'write_cmd': '{VALUE}SAC', 'item_type': 'str', 'dev_datatype': 'str', 'reply_pattern': r'SAC{LOOKUP}', 'lookup': 'AMP', 'item_attrs': {'attributes': {'remark': '0 = AMP, 1 = THR'}, 'lookup_item': True}},
'multizone': {'read': False, 'write': True, 'write_cmd': 'ZZ', 'item_type': 'str', 'dev_datatype': 'str'},
'multizone': {'read': True, 'write': True, 'write_cmd': 'ZZ', 'item_type': 'bool', 'dev_datatype': 'onoff', 'reply_pattern': r'(?:APR|BPR|ZEP)(\d{1})'},
'settings': {
'language': {'read': True, 'write': True, 'read_cmd': '?SSE', 'write_cmd': '{VALUE}SSE', 'item_type': 'str', 'dev_datatype': 'raw', 'reply_pattern': r'SSE{LOOKUP}', 'lookup': 'LANGUAGE', 'item_attrs': {'initial': True}},
'name': {'read': True, 'write': True, 'read_cmd': '?SSO', 'write_cmd': '{VALUE}SSO', 'item_type': 'str', 'dev_datatype': 'PioName', 'reply_pattern': r'SSO(?:\d{2})(.*)', 'item_attrs': {'initial': True}},
Expand Down
Loading
Loading