Skip to content

Commit

Permalink
Nit
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Feb 28, 2024
1 parent 059e49b commit 4676114
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/tools/interop/idt/discovery/dnssd.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ServiceTypeInfo:
"A service for Thread Radio Encapsulation Link which is a method for thread BRs to exchange data on IP links."
)

_SERVICE_INFO = {
_SERVICE_TYPE_INFO = {
"_matterd._udp.local.": _COMMISSIONER_SERVICE_INFO,
"_matterc._udp.local.": _COMMISSIONABLE_SERVICE_INFO,
"_matter._tcp.local.": _OPERATIONAL_SERVICE_INFO,
Expand Down Expand Up @@ -315,8 +315,8 @@ def handle_service_info(
to_log = "SERVICE EVENT\n"
to_log += f"{name}\n"
to_log += f"SERVICE {delta_type}\n"
to_log += _SERVICE_INFO[type_].type + "\n"
to_log += _SERVICE_INFO[type_].description + "\n"
to_log += _SERVICE_TYPE_INFO[type_].type + "\n"
to_log += _SERVICE_TYPE_INFO[type_].description + "\n"
info = zc.get_service_info(type_, name)
if info is not None:
self.discovered_matter_devices[name] = info
Expand All @@ -339,16 +339,16 @@ def update_service(self, zc: Zeroconf, type_: str, name: str) -> None:
def remove_service(self, zc: Zeroconf, type_: str, name: str) -> None:
to_log = "SERVICE_EVENT\n"
to_log += f"Service {name} removed\n"
to_log += _SERVICE_INFO[type_].type + "\n"
to_log += _SERVICE_INFO[type_].description
to_log += _SERVICE_TYPE_INFO[type_].type + "\n"
to_log += _SERVICE_TYPE_INFO[type_].description
if name in self.discovered_matter_devices:
del self.discovered_matter_devices[name]
self.logger.warning(to_log)
self.write_log(to_log, name)

def browse_interactive(self) -> None:
zc = Zeroconf()
ServiceBrowser(zc, list(_SERVICE_INFO.keys()), self)
ServiceBrowser(zc, list(_SERVICE_TYPE_INFO.keys()), self)
try:
self.logger.warning(
dedent("\
Expand All @@ -363,7 +363,7 @@ def browse_interactive(self) -> None:

async def browse_once(self, browse_time_seconds: int) -> Zeroconf:
zc = Zeroconf()
ServiceBrowser(zc, list(_SERVICE_INFO.keys()), self)
ServiceBrowser(zc, list(_SERVICE_TYPE_INFO.keys()), self)
await asyncio.sleep(browse_time_seconds)
zc.close()
return zc

0 comments on commit 4676114

Please sign in to comment.