Commit 3a1812be authored by davide's avatar davide

Added dmled and dmled4 auto-configuration

parent fda243e2
###########################################################################
# Copyright (c) 2011-2014 Unixmedia S.r.l. <info@unixmedia.it>
# Copyright (c) 2011-2014 Franco (nextime) Lanza <franco@unixmedia.it>
#
# Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it]
#
# This file is part of domotikad.
#
# domotikad 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from domotika.boards import iboards
from domotika.boards.boardtype import BaseBoard, ANABoard, INPBoard, OUTBoard
from zope.interface import implements
from twisted.plugin import IPlugin
try:
import hashlib
md5 = hashlib
md5.new = hashlib.md5
sha1 = hashlib.sha1
except:
import md5
import sha1
class DMBoard(INPBoard, ANABoard, OUTBoard, BaseBoard):
hasAnalogs = False
hasOutputs = False
hasInputs = True
hasRelays = False
hasAmperometers = False
fwtype = 'rgbled'
numInp = 3
class Board(object):
implements(IPlugin, iboards.IDMBoards)
def getBoard(self, host, port, pwd, lang):
return DMBoard(self.core, host, port, pwd, lang)
board=Board()
###########################################################################
# Copyright (c) 2011-2014 Unixmedia S.r.l. <info@unixmedia.it>
# Copyright (c) 2011-2014 Franco (nextime) Lanza <franco@unixmedia.it>
#
# Domotika System Controller Daemon "domotikad" [http://trac.unixmedia.it]
#
# This file is part of domotikad.
#
# domotikad 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 3 of the License, or
# (at your option) any later version.
#
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from domotika.boards import iboards
from domotika.boards.boardtype import BaseBoard, ANABoard, INPBoard, OUTBoard
from zope.interface import implements
from twisted.plugin import IPlugin
try:
import hashlib
md5 = hashlib
md5.new = hashlib.md5
sha1 = hashlib.sha1
except:
import md5
import sha1
class DMBoard(INPBoard, ANABoard, OUTBoard, BaseBoard):
hasAnalogs = False
hasOutputs = False
hasInputs = True
hasRelays = False
hasAmperometers = False
fwtype = 'rgbled4'
numInp = 10
class Board(object):
implements(IPlugin, iboards.IDMBoards)
def getBoard(self, host, port, pwd, lang):
return DMBoard(self.core, host, port, pwd, lang)
board=Board()
......@@ -327,7 +327,7 @@ class DomIkaBaseProtocol(object):
if str(arg[5:]) in ['DMRv3', 'DMRv1', 'DMSnt84','DMRv4']:
fwver=int(struct.unpack('<B', arg[4])[0])
self.core.addBoard(str(arg[5:]), fwver, src, host, 80, port, ptype)
elif str(arg[7:]) in ['DMRv3', 'DMRv1', 'DMSnt84','DMRv4']:
elif str(arg[7:]) in ['DMRv3', 'DMRv1', 'DMSnt84','DMRv4','DMLed4','DMLed']:
fwver=int(struct.unpack('<B', arg[4])[0])
webport=int(struct.unpack('<H', arg[5:7])[0])
self.core.addBoard(str(arg[7:]), fwver, src, host, webport, port, ptype)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment