Skip to content

Commit

Permalink
dlms plugin: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmxp committed Sep 6, 2023
1 parent d197ab4 commit 55c5415
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 320 deletions.
290 changes: 0 additions & 290 deletions dlms/README.md

This file was deleted.

11 changes: 7 additions & 4 deletions dlms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@


class DLMS(SmartPlugin, conversion.Conversion):
PLUGIN_VERSION = "1.9.4"

"""
This class provides a Plugin for SmarthomeNG to reads out a smartmeter.
The smartmeter needs to have an infrared interface and an IR-Adapter is needed for USB
Expand All @@ -68,6 +66,8 @@ class DLMS(SmartPlugin, conversion.Conversion):
the tag ``dlms_obis_readout`` will receive the last readout from smartmeter
"""

PLUGIN_VERSION = "1.9.5"

# tags this plugin handles
DLMS_OBIS_CODE = 'dlms_obis_code' # a single code in form of '1-1:1.8.1'
DLMS_OBIS_READOUT = 'dlms_obis_readout' # complete readout from smartmeter, if you want to examine codes yourself in a logic
Expand All @@ -78,7 +78,7 @@ class DLMS(SmartPlugin, conversion.Conversion):
def __init__(self, sh, *args, **kwargs ):
"""
Initializes the DLMS plugin
The parameter are retrieved from get_parameter_value(parameter_name)
The parameters are retrieved from get_parameter_value(parameter_name)
"""
from bin.smarthome import VERSION
if '.'.join(VERSION.split('.', 2)[:2]) <= '1.5':
Expand All @@ -92,6 +92,9 @@ def __init__(self, sh, *args, **kwargs ):
self.logger.error(f"{self.get_fullname()}: Unable to import Python package 'pyserial'")
return

# Call init code of parent class (SmartPlugin)
super().__init__()

self._instance = self.get_parameter_value('instance') # the instance of the plugin for questioning multiple smartmeter
self._update_cycle = self.get_parameter_value('update_cycle') # the frequency in seconds how often the device should be accessed
if self._update_cycle == 0:
Expand Down Expand Up @@ -145,7 +148,7 @@ def run(self):
self.alive = True
if self._update_cycle or self._update_crontab:
self.scheduler_add(self.get_shortname(), self._update_values_callback, prio=5, cycle=self._update_cycle, cron=self._update_crontab, next=shtime.now())
self.logger.debug("run dlms")
self.logger.debug(f"Plugin '{self.get_fullname()}': run method finished")

def stop(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions dlms/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ plugin:
tester: NONE # Who tests this plugin?
state: ready
keywords: dlms obis smartmeter
documentation: http://smarthomeng.de/user/plugins/dlms/user_doc.html
#documentation: http://smarthomeng.de/user/plugins/dlms/user_doc.html
support: https://knx-user-forum.de/forum/supportforen/smarthome-py/1002464-support-thread-für-dlms-plugin

version: 1.9.4 # Plugin version
version: 1.9.5 # Plugin version
sh_minversion: 1.8 # minimum shNG version to use this plugin
#sh_maxversion: # maximum shNG version to use this plugin (leave empty if latest)
py_minversion: 3.6 # minimum Python version to use for this plugin, due to f-strings
Expand Down
Loading

0 comments on commit 55c5415

Please sign in to comment.