Skip to content

Commit 4909227

Browse files
committed
Remove all legacy print console printing
1 parent 1fa311c commit 4909227

File tree

2 files changed

+1
-43
lines changed

2 files changed

+1
-43
lines changed

plugwise/nodes/circle_plus.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def __init__(self, mac, address, stick):
2525
self._plugwise_nodes = {}
2626
self._scan_response = {}
2727
self._scan_for_nodes_callback = None
28-
self._print_progress = False
2928
self._realtime_clock_offset = None
3029
self.get_real_time_clock(self.sync_realtime_clock)
3130

@@ -57,13 +56,6 @@ def _process_scan_response(self, message):
5756
"Process scan response for address %s", message.node_address.value
5857
)
5958
if message.node_mac.value != b"FFFFFFFFFFFFFFFF":
60-
if self.stick.print_progress:
61-
print(
62-
"Scan at address "
63-
+ str(message.node_address.value)
64-
+ " => node found with mac "
65-
+ message.node_mac.value.decode(UTF8_DECODE)
66-
)
6759
_LOGGER.debug(
6860
"Linked plugwise node with mac %s found",
6961
message.node_mac.value.decode(UTF8_DECODE),
@@ -75,13 +67,6 @@ def _process_scan_response(self, message):
7567
self._plugwise_nodes[
7668
message.node_mac.value.decode(UTF8_DECODE)
7769
] = message.node_address.value
78-
else:
79-
if self.stick.print_progress:
80-
print(
81-
"Scan at address "
82-
+ str(message.node_address.value)
83-
+ " => no node found"
84-
)
8570
if self._scan_for_nodes_callback:
8671
# Check if scan is complete before execute callback
8772
scan_complete = False

plugwise/stick.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
class stick:
9999
"""Plugwise connection stick."""
100100

101-
def __init__(self, port, callback=None, print_progress=False):
101+
def __init__(self, port, callback=None):
102102
self._mac_stick = None
103103
self.port = port
104104
self.network_online = False
@@ -119,7 +119,6 @@ def __init__(self, port, callback=None, print_progress=False):
119119
self._stick_callbacks = {}
120120
self.last_ack_seq_id = None
121121
self.expected_responses = {}
122-
self.print_progress = print_progress
123122
self.timezone_delta = datetime.now().replace(
124123
minute=0, second=0, microsecond=0
125124
) - datetime.utcnow().replace(minute=0, second=0, microsecond=0)
@@ -148,16 +147,10 @@ def init_finished():
148147
if not self.network_online:
149148
_LOGGER.Error("plugwise Zigbee network down")
150149
else:
151-
if self.print_progress:
152-
print("Scan Plugwise network")
153150
self.scan(callback)
154151

155152
try:
156-
if self.print_progress:
157-
print("Open port")
158153
self.connect()
159-
if self.print_progress:
160-
print("Initialize Plugwise USBstick")
161154
self.initialize_stick(init_finished)
162155
except PortError as e:
163156
_LOGGER.error("Failed to connect: '%s'", e)
@@ -417,8 +410,6 @@ def timeout_expired():
417410
def scan_circle_plus():
418411
"""Callback when Circle+ is discovered"""
419412
if self._plugwise_nodes.get(self.circle_plus_mac):
420-
if self.print_progress:
421-
print("Scan Circle+ for linked nodes")
422413
_LOGGER.debug("Scan Circle+ for linked nodes...")
423414
self._plugwise_nodes[self.circle_plus_mac].scan_for_nodes(scan_finished)
424415
else:
@@ -429,8 +420,6 @@ def scan_circle_plus():
429420
if self._plugwise_nodes.get(self.circle_plus_mac):
430421
scan_circle_plus()
431422
else:
432-
if self.print_progress:
433-
print("Discover Circle+")
434423
_LOGGER.debug("Discover Circle+ at %s", self.circle_plus_mac)
435424
self.discover_node(self.circle_plus_mac, scan_circle_plus)
436425
else:
@@ -486,36 +475,20 @@ def _append_node(self, mac, address, node_type):
486475
mac,
487476
)
488477
if node_type == NODE_TYPE_CIRCLE_PLUS:
489-
if self.print_progress:
490-
print("Circle+ node found using mac " + mac)
491478
self._plugwise_nodes[mac] = PlugwiseCirclePlus(mac, address, self)
492479
elif node_type == NODE_TYPE_CIRCLE:
493-
if self.print_progress:
494-
print("Circle node found using mac " + mac)
495480
self._plugwise_nodes[mac] = PlugwiseCircle(mac, address, self)
496481
elif node_type == NODE_TYPE_SWITCH:
497-
if self.print_progress:
498-
print("Unsupported switch node found using mac " + mac)
499482
self._plugwise_nodes[mac] = None
500483
elif node_type == NODE_TYPE_SENSE:
501-
if self.print_progress:
502-
print("Sense node found using mac " + mac)
503484
self._plugwise_nodes[mac] = PlugwiseSense(mac, address, self)
504485
elif node_type == NODE_TYPE_SCAN:
505-
if self.print_progress:
506-
print("Scan node found using mac " + mac)
507486
self._plugwise_nodes[mac] = PlugwiseScan(mac, address, self)
508487
elif node_type == NODE_TYPE_CELSIUS_SED:
509-
if self.print_progress:
510-
print("Unsupported Celsius SED node found using mac " + mac)
511488
self._plugwise_nodes[mac] = None
512489
elif node_type == NODE_TYPE_CELSIUS_NR:
513-
if self.print_progress:
514-
print("Unsupported Celsius NR found using mac " + mac)
515490
self._plugwise_nodes[mac] = None
516491
elif node_type == NODE_TYPE_STEALTH:
517-
if self.print_progress:
518-
print("Stealth node found using mac " + mac)
519492
self._plugwise_nodes[mac] = PlugwiseStealth(mac, address, self)
520493
else:
521494
_LOGGER.warning("Unsupported node type '%s'", str(node_type))

0 commit comments

Comments
 (0)