From edd3b967e6517a0abb30b634cf1da39b71ea46ce Mon Sep 17 00:00:00 2001 From: ststrobel Date: Sat, 21 Mar 2015 14:29:51 +0000 Subject: [PATCH] 98_ModbusAttr.pm: added Module for generic modbus devices, readings can be defined by attributes similar to HTTPMOD git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8254 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_ModbusAttr.pm | 248 +++++++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) create mode 100755 fhem/FHEM/98_ModbusAttr.pm diff --git a/fhem/FHEM/98_ModbusAttr.pm b/fhem/FHEM/98_ModbusAttr.pm new file mode 100755 index 000000000..df5844c65 --- /dev/null +++ b/fhem/FHEM/98_ModbusAttr.pm @@ -0,0 +1,248 @@ +############################################## +############################################## +# $Id: 98_ModbusAttr.pm +# +# generisches fhem Modul für Geräte mit Modbus-Interface +# verwendet Modbus.pm als Basismodul für die eigentliche Implementation des Protokolls. +# +# This file is part of fhem. +# +# Fhem is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# Fhem is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with fhem. If not, see . +# +############################################################################## +# Changelog: +# +# 2015-03-09 initial release +# + +package main; +use strict; +use warnings; + + +##################################### +sub +ModbusAttr_Initialize($) +{ + my ($modHash) = @_; + + require "$attr{global}{modpath}/FHEM/98_Modbus.pm"; + + ModbusLD_Initialize($modHash); # Generic function of the Modbus module does the rest + + $modHash->{AttrList} = $modHash->{AttrList} . " " . # Standard Attributes like IODEv etc + $modHash->{ObjAttrList} . " " . # Attributes to add or overwrite parseInfo definitions + $modHash->{DevAttrList}; # Attributes to add or overwrite devInfo definitions +} + + +1; + +=pod +=begin html + + +

ModbusAttr

+ + +=end html +=cut