Skip to content

Commit e3ea006

Browse files
committed
Use walrus operator
1 parent ebeb447 commit e3ea006

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugwise_usb/network/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ async def retrieve_network_registration(
145145
"""Return the network mac registration of specified address."""
146146
request = CirclePlusScanRequest(self._send_to_controller, self._mac_nc, address)
147147
response: CirclePlusScanResponse | None = await request.send()
148-
if response is None:
148+
if (response := await request.send()) is None:
149149
if retry:
150150
return await self.retrieve_network_registration(address, retry=False)
151151
return None
@@ -276,7 +276,7 @@ async def unregister_node(self, mac: str) -> None:
276276

277277
request = NodeRemoveRequest(self._send_to_controller, self._mac_nc, mac)
278278
response = await request.send()
279-
if response is None:
279+
if (response := await request.send()) is None:
280280
raise NodeError(
281281
f"The Zigbee network coordinator '{self._mac_nc!r}'"
282282
+ f" did not respond to unregister node '{mac}'"

0 commit comments

Comments
 (0)