@@ -55,12 +55,12 @@ def async_on_service_state_change(
5555async def _async_show_service_info (zeroconf : Zeroconf , service_type : str , name : str ) -> None :
5656 info = AsyncServiceInfo (service_type , name )
5757 await info .async_request (zeroconf , 3000 , question_type = DNSQuestionType .QU )
58- print ("Info from zeroconf.get_service_info: %r" % ( info ) )
58+ print (f "Info from zeroconf.get_service_info: { info !r } " )
5959 if info :
60- addresses = ["%s:%d" % ( addr , cast (int , info .port )) for addr in info .parsed_addresses ()]
61- print (" Name: %s" % name )
62- print (" Addresses: %s" % ", " .join (addresses ))
63- print (" Weight: %d , priority: %d" % ( info .weight , info . priority ) )
60+ addresses = [f" { addr } : { cast (int , info .port )} " for addr in info .parsed_addresses ()]
61+ print (f " Name: { name } " )
62+ print (f " Addresses: { ', ' .join (addresses )} " )
63+ print (f " Weight: { info . weight } , priority: { info .priority } " )
6464 print (f" Server: { info .server } " )
6565 if info .properties :
6666 print (" Properties are:" )
@@ -82,7 +82,7 @@ def __init__(self, args: Any) -> None:
8282 async def async_run (self ) -> None :
8383 self .aiozc = AsyncZeroconf (ip_version = ip_version )
8484 await self .aiozc .zeroconf .async_wait_for_start ()
85- print ("\n Browsing %s service(s), press Ctrl-C to exit...\n " % ALL_SERVICES )
85+ print (f "\n Browsing { ALL_SERVICES } service(s), press Ctrl-C to exit...\n " )
8686 kwargs = {
8787 "handlers" : [async_on_service_state_change ],
8888 "question_type" : DNSQuestionType .QU ,
0 commit comments