Skip to content

Commit

Permalink
Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shutgun committed Dec 2, 2020
1 parent cf7074c commit d1744fd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions devolo_plc_api/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ def _state_change(self, zeroconf: Zeroconf, service_type: str, name: str, state_

@staticmethod
def info_from_service(service_info: ServiceInfo) -> Optional[Dict]:
"""Return prepared info from mDNS entries."""
""" Return prepared info from mDNS entries. """
properties = {}
if not service_info.addresses:
return # No need to continue, if there is no IP address to contact the device
return None # No need to continue, if there is no IP address to contact the device

total_length = len(service_info.text)
offset = 0
Expand Down
10 changes: 10 additions & 0 deletions devolo_plc_api/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@


async def async_discover_network() -> Dict[str, Device]:
"""
Discover all devices that expose the devolo device API via mDNS asynchronous.
:return: Devices accessible via serial number.
"""
browser = ServiceBrowser(Zeroconf(), "_dvl-deviceapi._tcp.local.", [_add])
await asyncio.sleep(3)
browser.cancel()
Expand All @@ -19,6 +24,11 @@ async def async_discover_network() -> Dict[str, Device]:


def discover_network() -> Dict[str, Device]:
"""
Discover devices that expose the devolo device API via mDNS synchronous.
:return: Devices accessible via serial number.
"""
browser = ServiceBrowser(Zeroconf(), "_dvl-deviceapi._tcp.local.", [_add])
time.sleep(3)
browser.cancel()
Expand Down

0 comments on commit d1744fd

Please sign in to comment.