def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'BACKUP' self.address = 'backup' self.primary = self.address self.configured = False self.dsc = None self.mesg_thread = None self.discovery_ok = False self.current_state = [] self.params = node_funcs.NSParameters([{ 'name': 'IP Address', 'default': 'set me', 'isRequired': True, 'notice': 'IP Address of ISY must be set', }, { 'name': 'Username', 'default': 'set me', 'isRequired': True, 'notice': 'ISY Username must be set', }, { 'name': 'Password', 'default': 'set me', 'isRequired': True, 'notice': 'ISY Password must be set', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'AERIS Weather' self.address = 'weather' self.primary = self.address self.configured = False self.latitude = 0 self.longitude = 0 self.force = True self.tag = {} self.params = node_funcs.NSParameters([ { 'name': 'ClientID', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS Client ID must be set', }, { 'name': 'ClientSecret', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS Client Secret must be set', }, { 'name': 'Location', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS location must be set', }, { 'name': 'Units', 'default': 'imperial', 'isRequired': False, 'notice': '', }, { 'name': 'Forecast Days', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Elevation', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Plant Type', 'default': '0.23', 'isRequired': False, 'notice': '', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'Climacell Weather' self.address = 'weather' self.primary = self.address self.configured = False self.latitude = 0 self.longitude = 0 self.force = True self.params = node_funcs.NSParameters([ { 'name': 'APIKey', 'default': 'set me', 'isRequired': True, 'notice': 'climacell API key must be set', }, { 'name': 'Latitude', 'default': '-59.9 to 59.9', 'isRequired': True, 'notice': 'Latitude must be set', }, { 'name': 'Longitude', 'default': '-180 to 180', 'isRequired': True, 'notice': 'Longitude must be set', }, { 'name': 'Units', 'default': 'us', 'isRequired': False, 'notice': '', }, { 'name': 'Forecast Days', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Elevation', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Plant Type', 'default': '0.23', 'isRequired': False, 'notice': '', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'OpenWeatherMap' self.address = 'weather' self.primary = self.address self.configured = False self.discovery = False self.start_finished = False self.params = node_funcs.NSParameters([ { 'name': 'APIkey', 'default': 'set me', 'isRequired': True, 'notice': 'OpenWeatherMap API key must be set', }, { 'name': 'Location', 'default': 'set me', 'isRequired': True, 'notice': 'OpenWeatherMap location must be set', }, { 'name': 'Units', 'default': 'imperial', 'isRequired': False, 'notice': '', }, { 'name': 'Forecast Days', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Elevation', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Plant Type', 'default': '0.23', 'isRequired': False, 'notice': '', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) # are these overriding the class variables? self.name = 'WeatherLink' self.address = 'wl' self.primary = self.address self.stopping = False self.stopped = True self.poly.onConfig(self.process_config) self.devices = [] self.discovered = "" self.configured = False self.tags = {} self.hb = 0 self.params = node_funcs.NSParameters([{ 'name': 'Device ID', 'default': 'set me', 'isRequired': True, 'notice': 'Device ID must be set', }, { 'name': 'Password', 'default': 'set me', 'isRequired': True, 'notice': 'Password must be set', }, { 'name': 'API Token', 'default': 'set me', 'isRequired': True, 'notice': 'API Token must be set', }, { 'name': 'Station ID', 'default': '', 'isRequired': False, 'notice': '', }, { 'name': 'Units', 'default': 'us', 'isRequired': False, 'notice': '', }, ])
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'RussoundRIO' self.address = 'rio' self.primary = self.address self.configured = False self.rio = None self.sock = None self.mesg_thread = None self.source_status = 0x00 # assume all sources are inactive self.params = node_funcs.NSParameters([ { 'name': 'IP Address', 'default': 'IP of MCA Controller', 'isRequired': True, 'notice': 'IP Address of serial network interface must be set', }, { 'name': 'Port', 'default': '9621', 'isRequired': False, 'notice': '', }, { 'name': 'Number of Controllers', 'default': '1', 'isRequired': False, 'notice': '', }, { 'name': 'Zones per Controller', 'default': '6', 'isRequired': False, 'notice': '', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'Volumio' self.address = 'vctl' self.primary = self.address self.roku_list = {} self.in_config = False self.configured = False self.server = None self.sources = [] self.ip_address = '' self.params = node_funcs.NSParameters([{ 'name': 'IP Address', 'default': 'set volumio IP address', 'isRequired': True, 'notice': 'IP address/name must be set' }]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) self.name = 'Russound' self.address = 'rnet' self.primary = self.address self.configured = False self.rnet = None self.sock = None self.mesg_thread = None self.source_status = 0x00 # assume all sources are inactive self.params = node_funcs.NSParameters([{ 'name': 'IP Address', 'default': 'set me', 'isRequired': True, 'notice': 'IP Address of serial network interface must be set', }, { 'name': 'Port', 'default': '0', 'isRequired': True, 'notice': 'Serial network interface port must be set', }, { 'name': 'Network Protocol', 'default': 'UDP', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 1', 'default': 'Zone 1', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 2', 'default': 'Zone 2', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 3', 'default': 'Zone 3', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 4', 'default': 'Zone 4', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 5', 'default': 'Zone 5', 'isRequired': False, 'notice': '', }, { 'name': 'Zone 6', 'default': 'Zone 6', 'isRequired': False, 'notice': '', }, ]) self.poly.onConfig(self.process_config)
def __init__(self, polyglot): super(Controller, self).__init__(polyglot) # are these overriding the class variables? self.name = 'WeatherFlow' self.address = 'wf' self.primary = self.address self.stopping = False self.stopped = True self.rain_data = { 'hourly': 0, 'hour': 0, 'daily': 0, 'day': 0, 'weekly': 0, 'week': 0, 'monthly': 0, 'month': 0, 'yearly': 0, 'year': 0, 'yesterday': 0, 'level': 30, 'station': '', } self.hb = 0 self.hub_timestamp = 0 self.tempest = False self.poly.onConfig(self.process_config) self.poly.onStop(self.my_stop) self.devices = [] self.discovered = "" self.units = { 'temperature': 'c', 'wind': 'kph', 'pressure': 'mb', 'rain': 'mm', 'distance': 'km', 'other': 'metric', } self.params = node_funcs.NSParameters([ { 'name': 'Station', 'default': 'set me', 'isRequired': True, 'notice': 'Station ID must be set', }, { 'name': 'ListenPort', 'default': 50222, 'isRequired': False, 'notice': '', }, { 'name': 'Sky S/N', 'default': '', 'isRequired': False, 'notice': '', }, { 'name': 'Air S/N', 'default': '', 'isRequired': False, 'notice': '', }, { 'name': 'Tempest S/N', 'default': '', 'isRequired': False, 'notice': '', }, { 'name': 'Units', 'default': 'us', 'isRequired': False, 'notice': '', }, { 'name': 'Elevation', 'default': 0, 'isRequired': False, 'notice': '', }, { 'name': 'AGL', 'default': 0, 'isRequired': False, 'notice': '', }, ])
def __init__(self, polyglot, primary, address, name): super(Controller, self).__init__(polyglot, primary, address, name) self.poly = polyglot self.name = name self.address = address self.primary = primary self.configured = False self.force = True self.node_added_count = 0 self.Notices = Custom(polyglot, 'notices') self.Parameters = Custom(polyglot, 'customparams') self.params = node_funcs.NSParameters([ { 'name': 'ClientID', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS Client ID must be set', }, { 'name': 'ClientSecret', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS Client Secret must be set', }, { 'name': 'Location', 'default': 'set me', 'isRequired': True, 'notice': 'AERIS location must be set', }, { 'name': 'Units', 'default': 'imperial', 'isRequired': False, 'notice': '', }, { 'name': 'Forecast Days', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Elevation', 'default': '0', 'isRequired': False, 'notice': '', }, { 'name': 'Plant Type', 'default': '0.23', 'isRequired': False, 'notice': '', }, ]) self.q = query.queries(self.poly) self.poly.subscribe(self.poly.CONFIG, self.configHandler) self.poly.subscribe(self.poly.CUSTOMPARAMS, self.parameterHandler) self.poly.subscribe(self.poly.START, self.start) self.poly.subscribe(self.poly.POLL, self.poll) self.poly.subscribe(self.poly.ADDNODEDONE, self.nodeHandler) self.poly.ready() self.poly.addNode(self)