{% block buttons %}
@@ -120,7 +120,7 @@ {{ _('Plugin') }} : {% if p.alive %}{{_('Aktiv')}}{% else %}{{
{% endif %}
-
+
{% if tabcount == 1 %}
- {{ tab1title }}
diff --git a/modules/mqtt/__init__.py b/modules/mqtt/__init__.py
index 587d6b6a5a..d8d29d7a37 100644
--- a/modules/mqtt/__init__.py
+++ b/modules/mqtt/__init__.py
@@ -169,7 +169,7 @@ def __init__(self, sh):
# return
pass
-
+
def start(self):
"""
This method starts the mqtt module
@@ -530,7 +530,7 @@ def _on_mqtt_message(self, client, userdata, message):
with self._subscribed_topics_lock:
subscibed_topics = list(self._subscribed_topics.keys())
-
+
# look for subscriptions to the received topic
subscription_found = False
for topic in subscibed_topics:
@@ -725,7 +725,7 @@ def _get_caller_type(self):
source_type = 'Plugin'
elif split[-3] == 'plugins':
source_type = 'Plugin'
- elif split[-3] == 'logics':
+ elif split[-2] == 'logics':
source_type = 'Logic'
else:
source_type = 'Unknown'
diff --git a/modules/websocket/__init__.py b/modules/websocket/__init__.py
index 12ca71db74..12de377674 100644
--- a/modules/websocket/__init__.py
+++ b/modules/websocket/__init__.py
@@ -480,7 +480,6 @@ async def smartVISU_protocol_v4(self, websocket):
elif command == 'logic':
answer = {}
await self.request_logic(data, client_addr)
- self.logger.warning("{} /requirements not found!")
exit(1)
-req_files = shpypi.Requirements_files()
+#req_files = shpypi.req_files('1.9.0.1', for_tests=True)
# req_files.create_requirementsfile('core')
# print("File 'requirements" + os.sep + "core.txt' created.")
# req_files.create_requirementsfile('modules')
# print("File 'requirements" + os.sep + "modules.txt' created.")
-fn = req_files.create_requirementsfile('base')
+fn = shpypi.req_files.create_requirementsfile('base')
print("File {} created.".format(fn))
# req_files.create_requirementsfile('plugins')
# print("File 'requirements" + os.sep + "plugins.txt' created.")
-fn = req_files.create_requirementsfile('all')
+fn = shpypi.req_files.create_requirementsfile('all')
print("File {} created.".format(fn))
diff --git a/tools/plugin_metadata_checker.py b/tools/plugin_metadata_checker.py
index 95c66160ff..5fa77223c2 100644
--- a/tools/plugin_metadata_checker.py
+++ b/tools/plugin_metadata_checker.py
@@ -32,7 +32,7 @@
import os
import argparse
-VERSION = '1.7.6'
+VERSION = '1.7.8'
print('')
print(os.path.basename(__file__) + ' v' + VERSION + ' - Checks the care status of plugin metadata')
@@ -600,6 +600,13 @@ def check_metadata(plg, with_description, check_quiet=False, only_inc=False, lis
print("Check metadata of {} plugin '{}'".format(plg_type, plg))
print()
+ # Checking plugin name
+ maxlen = 12
+ if len(plg) > maxlen:
+ disp_warning(f"A plugin name should not be longer than {maxlen} characters.", f"The plugin name '{plg}' is {len(plg)} characters long")
+ if plg != plg.lower():
+ disp_error(f"Invalid plugin name '{plg}'.", f"Plugin names have to be lower case. Use '{plg.lower()}' instead")
+
# Checking global metadata
if metadata.get('plugin', None) == None:
disp_error("No global metadata defined", "Make sure to create a section 'plugin' and fill it with the necessary entries", "Take a look at https://www.smarthomeng.de/developer/development_plugin/plugin_metadata.html")
@@ -621,8 +628,8 @@ def check_metadata(plg, with_description, check_quiet=False, only_inc=False, lis
else:
if metadata['plugin'].get('state', None) == None:
disp_error('No development state given for the plugin', "Add 'state:' to the plugin section and set it to one of the following values ['develop', 'ready', 'qa-passed']", "The state'qa-passed' should only be set by the shNG core team")
- elif not metadata['plugin'].get('state', None) in ['qa-passed', 'ready', 'develop', '-']:
- disp_error('An invalid development state is given for the plugin', "Set'state:' to one of the followind valid values ['develop', 'ready', 'qa-passed']", "The state'qa-passed' should only be set by the shNG core team")
+ elif not metadata['plugin'].get('state', None) in ['qa-passed', 'ready', 'develop', 'deprecated', '-']:
+ disp_error('An invalid development state is given for the plugin', "Set'state:' to one of the followind valid values ['develop', 'ready', 'qa-passed', 'deprecated']", "The state'qa-passed' should only be set by the shNG core team")
if metadata['plugin'].get('multi_instance', None) == None:
disp_warning('It is not documented if wether the plugin is multi-instance capable or not', "Add 'multi_instance:' to the plugin section")
@@ -673,7 +680,7 @@ def check_metadata(plg, with_description, check_quiet=False, only_inc=False, lis
if not is_dict(par_dict):
disp_error("Definition of parameter '{}' is not a dict".format(par), '')
else:
- if par_dict.get('mandatory', None) != None and par_dict.get('default', None) != None:
+ if par_dict.get('mandatory', False) != False and par_dict.get('default', None) != None:
disp_error("parameter '{}': mandatory and default cannot be used together".format(par), "If mandatory and a default value are specified togeather, mandatory has no effect, since a value for the parameter is already specified (the default value).")
test_description('parameter', par, par_dict.get('description', None))
@@ -684,7 +691,7 @@ def check_metadata(plg, with_description, check_quiet=False, only_inc=False, lis
if not is_dict(par_dict):
disp_error("Definition of item_attribute '{}' is not a dict".format(par), '')
else:
- if par_dict.get('mandatory', None) != None and par_dict.get('default', None) != None:
+ if par_dict.get('mandatory', False) != False and par_dict.get('default', None) != None:
disp_error("item '{}': mandatory and default cannot be used together".format(par), "If mandatory and a default value are specified togeather, mandatory has no effect, since a value for the parameter is already specified (the default value).")
test_description('item attribute', par, par_dict.get('description', None))
|