9898class 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