@@ -750,36 +750,33 @@ def _discover_after_scan(self):
750750 self .do_callback (CB_NEW_NODE , node_discovered )
751751 self .auto_update ()
752752
753- def discover_node (self , mac : str , callback = None , force_discover = False ) -> bool :
753+ def discover_node (self , mac : str , callback = None , force_discover = False ):
754754 """Helper to try to discovery the node (type) based on mac."""
755- if validate_mac (mac ):
756- if not self ._plugwise_nodes .get (mac ):
757- if mac not in self ._nodes_not_discovered :
758- self ._nodes_not_discovered [mac ] = (
759- None ,
760- None ,
761- )
762- self .msg_controller .send (
763- NodeInfoRequest (bytes (mac , UTF8_DECODE )),
764- callback ,
765- )
766- else :
767- (firstrequest , lastrequest ) = self ._nodes_not_discovered [mac ]
768- if not (firstrequest and lastrequest ):
769- self .msg_controller .send (
770- NodeInfoRequest (bytes (mac , UTF8_DECODE )),
771- callback ,
772- 0 ,
773- PRIORITY_LOW ,
774- )
775- elif force_discover :
776- self .msg_controller .send (
777- NodeInfoRequest (bytes (mac , UTF8_DECODE )),
778- callback ,
779- )
780- return True
781- return False
782- return False
755+ if not validate_mac (mac ) or self ._plugwise_nodes .get (mac ):
756+ return
757+ if mac not in self ._nodes_not_discovered :
758+ self ._nodes_not_discovered [mac ] = (
759+ None ,
760+ None ,
761+ )
762+ self .msg_controller .send (
763+ NodeInfoRequest (bytes (mac , UTF8_DECODE )),
764+ callback ,
765+ )
766+ else :
767+ (firstrequest , lastrequest ) = self ._nodes_not_discovered [mac ]
768+ if not (firstrequest and lastrequest ):
769+ self .msg_controller .send (
770+ NodeInfoRequest (bytes (mac , UTF8_DECODE )),
771+ callback ,
772+ 0 ,
773+ PRIORITY_LOW ,
774+ )
775+ elif force_discover :
776+ self .msg_controller .send (
777+ NodeInfoRequest (bytes (mac , UTF8_DECODE )),
778+ callback ,
779+ )
783780
784781 ## TODO: All functions below can be removed when HA component is changed to use the property values ##
785782 def get_mac_stick (self ) -> str :
0 commit comments