Skip to content

Commit

Permalink
General cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cbpowell committed May 6, 2023
1 parent 641d80e commit 5860e8a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions senselink/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .senselink import SenseLink
from .plug_instance import PlugInstance
from .data_source import DataSource, MutableSource, AggregateSource
8 changes: 4 additions & 4 deletions senselink/senselink.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class SenseLink:
should_respond = True
has_aggregate = False

def __init__(self, config, port=9999):
def __init__(self, config=None, port=9999):
self.config = config
self.port = port
self.target = None
Expand Down Expand Up @@ -195,16 +195,16 @@ def create_instances(self):
port = mqtt_conf.get('port') or 1883
username = mqtt_conf.get('username') or None
password = mqtt_conf.get('password') or None
mqtt_controller = MQTTController(host, port, username, password)
mqtt_cont = MQTTController(host, port, username, password)

# Generate plug instances
plugs = mqtt_conf[PLUGS_KEY]
logging.info("Generating MQTT instances")
instances = PlugInstance.configure_plugs(plugs, MQTTSource, mqtt_controller)
instances = PlugInstance.configure_plugs(plugs, MQTTSource, mqtt_cont)
self.add_instances(instances)

# Start controller
mqtt_task = mqtt_controller.connect()
mqtt_task = mqtt_cont.connect()
self.tasks.add(mqtt_task)

# Aggregate-type Plugs
Expand Down

0 comments on commit 5860e8a

Please sign in to comment.