Skip to content

Commit

Permalink
Merge pull request smarthomeNG#614 from Morg42/develop
Browse files Browse the repository at this point in the history
sdp: minor fixes
  • Loading branch information
Morg42 authored Jan 11, 2024
2 parents 6b9d3cf + c87f942 commit 6cff49e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/model/sdp/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def get_shng_data(self, command, data, **kwargs):
try:
result = self._lookup(result, lu)
except ValueError as e:
self.logger.warning(f'whie parsing reply to {command}, the lookup of {lu} failed: {e}')
self.logger.warning(f'while parsing reply to {command}, the lookup of {lu} failed: {e}')
return
return result

Expand Down
19 changes: 13 additions & 6 deletions lib/model/smartdeviceplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -1238,11 +1238,6 @@ def __init__(self, plugin_class, plugin_file):
``__init__.py -v``
If you add the -a parameter, all items will have an added
``visu_acl: <ro>/<rw>``
attribute depending on the read/write configuration.
========================================================================
If you call it with -s as a parameter, the plugin will insert the struct
Expand All @@ -1251,6 +1246,14 @@ def __init__(self, plugin_class, plugin_file):
``__init__.py -s``
If you add the -a parameter, all items will have an added
``visu_acl: <ro>/<rw>``
attribute depending on the read/write configuration.
If you add the -l parameter, all items will be lowercase.
"""
self.logger = logging.getLogger(__name__)
self.logger.setLevel(logging.CRITICAL)
Expand All @@ -1266,6 +1269,7 @@ def __init__(self, plugin_class, plugin_file):

self.struct_mode = False
self.acl = False
self.lc = False

self.indentwidth = 4

Expand All @@ -1287,6 +1291,9 @@ def __init__(self, plugin_class, plugin_file):
elif arg_str[:2].lower() == '-a':
self.acl = True

elif arg_str[:2].lower() == '-l':
self.lc = True

else:
try:
# convertible to dict?
Expand Down Expand Up @@ -1328,7 +1335,7 @@ def __init__(self, plugin_class, plugin_file):
def add_item_to_tree(self, item_path, item_dict):
""" add entry for custom read group triggers """

dst_path_elems = item_path.split('.')
dst_path_elems = item_path.lower().split('.')
item = {dst_path_elems[-1]: item_dict}
for elem in reversed(dst_path_elems[:-1]):
item = {elem: item}
Expand Down

0 comments on commit 6cff49e

Please sign in to comment.