Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions plugwise/nodes/circle_plus.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def __init__(self, mac, address, stick):
self._plugwise_nodes = {}
self._scan_response = {}
self._scan_for_nodes_callback = None
self._print_progress = False
self._realtime_clock_offset = None
self.get_real_time_clock(self.sync_realtime_clock)

Expand Down Expand Up @@ -57,13 +56,6 @@ def _process_scan_response(self, message):
"Process scan response for address %s", message.node_address.value
)
if message.node_mac.value != b"FFFFFFFFFFFFFFFF":
if self.stick.print_progress:
print(
"Scan at address "
+ str(message.node_address.value)
+ " => node found with mac "
+ message.node_mac.value.decode(UTF8_DECODE)
)
_LOGGER.debug(
"Linked plugwise node with mac %s found",
message.node_mac.value.decode(UTF8_DECODE),
Expand All @@ -75,13 +67,6 @@ def _process_scan_response(self, message):
self._plugwise_nodes[
message.node_mac.value.decode(UTF8_DECODE)
] = message.node_address.value
else:
if self.stick.print_progress:
print(
"Scan at address "
+ str(message.node_address.value)
+ " => no node found"
)
if self._scan_for_nodes_callback:
# Check if scan is complete before execute callback
scan_complete = False
Expand Down
29 changes: 1 addition & 28 deletions plugwise/stick.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
class stick:
"""Plugwise connection stick."""

def __init__(self, port, callback=None, print_progress=False):
def __init__(self, port, callback=None):
self._mac_stick = None
self.port = port
self.network_online = False
Expand All @@ -119,7 +119,6 @@ def __init__(self, port, callback=None, print_progress=False):
self._stick_callbacks = {}
self.last_ack_seq_id = None
self.expected_responses = {}
self.print_progress = print_progress
self.timezone_delta = datetime.now().replace(
minute=0, second=0, microsecond=0
) - datetime.utcnow().replace(minute=0, second=0, microsecond=0)
Expand Down Expand Up @@ -148,16 +147,10 @@ def init_finished():
if not self.network_online:
_LOGGER.Error("plugwise Zigbee network down")
else:
if self.print_progress:
print("Scan Plugwise network")
self.scan(callback)

try:
if self.print_progress:
print("Open port")
self.connect()
if self.print_progress:
print("Initialize Plugwise USBstick")
self.initialize_stick(init_finished)
except PortError as e:
_LOGGER.error("Failed to connect: '%s'", e)
Expand Down Expand Up @@ -417,8 +410,6 @@ def timeout_expired():
def scan_circle_plus():
"""Callback when Circle+ is discovered"""
if self._plugwise_nodes.get(self.circle_plus_mac):
if self.print_progress:
print("Scan Circle+ for linked nodes")
_LOGGER.debug("Scan Circle+ for linked nodes...")
self._plugwise_nodes[self.circle_plus_mac].scan_for_nodes(scan_finished)
else:
Expand All @@ -429,8 +420,6 @@ def scan_circle_plus():
if self._plugwise_nodes.get(self.circle_plus_mac):
scan_circle_plus()
else:
if self.print_progress:
print("Discover Circle+")
_LOGGER.debug("Discover Circle+ at %s", self.circle_plus_mac)
self.discover_node(self.circle_plus_mac, scan_circle_plus)
else:
Expand Down Expand Up @@ -486,36 +475,20 @@ def _append_node(self, mac, address, node_type):
mac,
)
if node_type == NODE_TYPE_CIRCLE_PLUS:
if self.print_progress:
print("Circle+ node found using mac " + mac)
self._plugwise_nodes[mac] = PlugwiseCirclePlus(mac, address, self)
elif node_type == NODE_TYPE_CIRCLE:
if self.print_progress:
print("Circle node found using mac " + mac)
self._plugwise_nodes[mac] = PlugwiseCircle(mac, address, self)
elif node_type == NODE_TYPE_SWITCH:
if self.print_progress:
print("Unsupported switch node found using mac " + mac)
self._plugwise_nodes[mac] = None
elif node_type == NODE_TYPE_SENSE:
if self.print_progress:
print("Sense node found using mac " + mac)
self._plugwise_nodes[mac] = PlugwiseSense(mac, address, self)
elif node_type == NODE_TYPE_SCAN:
if self.print_progress:
print("Scan node found using mac " + mac)
self._plugwise_nodes[mac] = PlugwiseScan(mac, address, self)
elif node_type == NODE_TYPE_CELSIUS_SED:
if self.print_progress:
print("Unsupported Celsius SED node found using mac " + mac)
self._plugwise_nodes[mac] = None
elif node_type == NODE_TYPE_CELSIUS_NR:
if self.print_progress:
print("Unsupported Celsius NR found using mac " + mac)
self._plugwise_nodes[mac] = None
elif node_type == NODE_TYPE_STEALTH:
if self.print_progress:
print("Stealth node found using mac " + mac)
self._plugwise_nodes[mac] = PlugwiseStealth(mac, address, self)
else:
_LOGGER.warning("Unsupported node type '%s'", str(node_type))
Expand Down