self._mode = data[2] self._range = float(data[3]) def to_json(self): """ :return: str """ # FIXME json_dict = self.to_json_basic() json_dict['current'] = self._current json_dict['mode'] = self._mode json_dict['set_point'] = self._set_point json_dict['range'] = self._range return json.dumps(json_dict) class TE1TemperaturetatusMessage(GenericTemperaturetatusMessage): def __init__(self, address=None): GenericTemperaturetatusMessage.__init__(self) self.moduleType = TE1_COMMAND_CODE class TE2TemperaturetatusMessage(GenericTemperaturetatusMessage): def __init__(self, address=None): GenericTemperaturetatusMessage.__init__(self) self.moduleType = TE2_COMMAND_CODE domintell.register_command(TE1_COMMAND_CODE, TE1TemperaturetatusMessage) domintell.register_command(TE2_COMMAND_CODE, TE2TemperaturetatusMessage)
class InfoMessage(domintell.Message): """ Generic info message """ def __init__(self, moduleType=None, data=None): domintell.Message.__init__(self) self._message = '' if (moduleType == 'INF' and data[0:5] == 'INFO:') or moduleType == '!! ' or ( moduleType == 'APP' and data[0:7] == 'APPINFO'): self.moduleType = 'INFO' self._message = data def populate(self, serialNumber, dataType, dataString): pass def to_json(self): """ :return: str """ json_dict = self.to_json_basic() json_dict['info_message'] = self._message return json.dumps(json_dict) domintell.register_command("INF", InfoMessage) domintell.register_command("!! ", InfoMessage) domintell.register_command("APP", InfoMessage)
""" BIR module status Output card to control 8 250V/8A two-pole relays. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericAOStatusMessage class DDIMStatusMessage(GenericAOStatusMessage): COMMAND_CODE = 'DIM' """ DDIM module status """ def __init__(self, address=None): GenericAOStatusMessage.__init__(self, 8) self.moduleType = DDIMStatusMessage.COMMAND_CODE domintell.register_command(DDIMStatusMessage.COMMAND_CODE, DDIMStatusMessage)
""" BIR module status Output card to control 8 250V/8A two-pole relays. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDOStatusMessage BIR_COMMAND_CODE = "BIR" class DBIRStatusMessage(GenericDOStatusMessage): """ DBIR module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 8) self.moduleType = BIR_COMMAND_CODE domintell.register_command(BIR_COMMAND_CODE, DBIRStatusMessage)
""" :author: Thomas Delaet <*****@*****.**> """ import domintell COMMAND_CODE = "__MODULE_STATUS__" class ModuleStatusRequest(domintell.Command): """ Request module status """ def __init__(self, moduleType, serialNumber): domintell.Command.__init__(self, moduleType, serialNumber) self.moduleType = moduleType def command(self): return "{:3}{:>6}%S".format(self.moduleType, self.serialNumber) domintell.register_command(COMMAND_CODE, ModuleStatusRequest)
:author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDOStatusMessage TRV_COMMAND_CODE = "TRV" V24_COMMAND_CODE = "V24" class DTRVStatusMessage(GenericDOStatusMessage): """ DBIR module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 8) self.moduleType = TRV_COMMAND_CODE class DTRVBTStatusMessage(GenericDOStatusMessage): """ DBIR module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 1) self.moduleType = V24_COMMAND_CODE domintell.register_command(TRV_COMMAND_CODE, DTRVStatusMessage) domintell.register_command(V24_COMMAND_CODE, DTRVBTStatusMessage)
self.inputs[0] = self.var def to_json(self): """ :return: str """ json_dict = self.to_json_basic() json_dict['var'] = self.var return json.dumps(json_dict) class VARStatusMessage(GenericVARStatusMessage): """ VAR status """ def __init__(self, address=None): GenericVARStatusMessage.__init__(self, VAR_COMMAND_CODE) class SYSStatusMessage(GenericVARStatusMessage): """ SYS status """ def __init__(self, address=None): GenericVARStatusMessage.__init__(self, SYS_COMMAND_CODE) domintell.register_command(VAR_COMMAND_CODE, VARStatusMessage) domintell.register_command(SYS_COMMAND_CODE, SYSStatusMessage)
This module permits the direct connection of 1 to 4 push buttons (DISM04) or from 1 to 8 push buttons (DISM08) or any other inputs, detectors, etc. Each DISM0x has a unique number which enables it to be :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages.di_status import GenericDIStatusMessage IS4_COMMAND_CODE = "IS4" IS8_COMMAND_CODE = "IS8" class DISM4StatusMessage(GenericDIStatusMessage): """ DISM4 module status """ def __init__(self, address=None): GenericDIStatusMessage.__init__(self, IS4_COMMAND_CODE, 4) class DISM8StatusMessage(GenericDIStatusMessage): """ DISM8 module status """ def __init__(self, address=None): GenericDIStatusMessage.__init__(self, IS8_COMMAND_CODE, 8) domintell.register_command(IS4_COMMAND_CODE, DISM4StatusMessage) domintell.register_command(IS8_COMMAND_CODE, DISM8StatusMessage)
self.serialNumber = serialNumber if dataType == "I": mask = int(dataString[0:2].strip(), 16) for input in range(0, self.inputCount): self.inputs[input] = 1 if (mask & (input + 1)) else 0 elif dataType == "T": data = dataString.split() self.current = Decimal(data[0]) self.setPoint = Decimal(data[1]) self.mode = data[2] self.range = Decimal(data[3]) def to_json(self): """ :return: str """ json_dict = self.to_json_basic() for input in range(0, self.inputCount): if input < len(self.inputs): json_dict['input{}'.format(input)] = self.inputs[input] json_dict['current'] = DecimalEncoder().encode(self.current) json_dict['mode'] = self.mode json_dict['setPoint'] = DecimalEncoder().encode(self.setPoint) json_dict['range'] = DecimalEncoder().encode(self.range) return json.dumps(json_dict) domintell.register_command(DTSC_COMMAND_CODE, DTSCStatusMessage)
""" DMOV01 & DMOV01 module status PIR movement detector. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDIStatusMessage DMOV_COMMAND_CODE = "DET" class DMOVStatusMessage(GenericDIStatusMessage): """ DMOV module status """ def __init__(self, address=None): GenericDIStatusMessage.__init__(self, 1) self.moduleType = DMOV_COMMAND_CODE domintell.register_command(DMOV_COMMAND_CODE, DMOVStatusMessage)
""" DPBU02 module status """ def __init__(self, address=None): GenericDIOStatusMessage.__init__(self, 2) self.moduleType = BU2_COMMAND_CODE class DPBU04StatusMessage(DPBU02StatusMessage): """ DPBU04 module status """ def __init__(self, address=None): GenericDIOStatusMessage.__init__(self, 4) self.moduleType = BU4_COMMAND_CODE class DPBU06StatusMessage(DPBU04StatusMessage): """ DPBU06 module status """ def __init__(self, address=None): GenericDIOStatusMessage.__init__(self, 6) self.moduleType = BU6_COMMAND_CODE domintell.register_command(BU1_COMMAND_CODE, DPBU01StatusMessage) domintell.register_command(BU2_COMMAND_CODE, DPBU02StatusMessage) domintell.register_command(BU4_COMMAND_CODE, DPBU04StatusMessage) domintell.register_command(BU6_COMMAND_CODE, DPBU06StatusMessage)
""" BIR module status Output card to control 8 250V/8A two-pole relays. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericAIStatusMessage DIN10V_COMMAND_CODE = "I10" class DIN10VStatusMessage(GenericAIStatusMessage): """ I10 module status """ def __init__(self, address=None): GenericAIStatusMessage.__init__(self, 10) self.moduleType = DIN10V_COMMAND_CODE domintell.register_command(DIN10V_COMMAND_CODE, DIN10VStatusMessage)
""" DMR module status Output card to control 8 250V/8A two-pole relays. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDOStatusMessage DMR_COMMAND_CODE = "DMR" class DDMRStatusMessage(GenericDOStatusMessage): """ DBIR module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 5) self.moduleType = DMR_COMMAND_CODE domintell.register_command(DMR_COMMAND_CODE, DDMRStatusMessage)
""" DTRP module status Output card for the control of 1 to 4 trip switches. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDOStatusMessage TRP_COMMAND_CODE = "TRP" class DTRPStatusMessage(GenericDOStatusMessage): """ DTRP module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 4) self.moduleType = TRP_COMMAND_CODE domintell.register_command(TRP_COMMAND_CODE, DTRPStatusMessage)
""" BIR module status Output card to control 8 250V/8A two-pole relays. :author: Zilvinas Binisevicius <*****@*****.**> """ import json import domintell from domintell.messages import GenericDOStatusMessage LED_COMMAND_CODE = "LED" class DLEDStatusMessage(GenericDOStatusMessage): """ DBIR module status """ def __init__(self, address=None): GenericDOStatusMessage.__init__(self, 4) self.moduleType = LED_COMMAND_CODE domintell.register_command(LED_COMMAND_CODE, DLEDStatusMessage)