Skip to content

Python library to scan local network for mDNS and uPnP services and devices.

License

Notifications You must be signed in to change notification settings

heman4t/netdisco

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetDisco

NetDisco is a Python library to discover local devices and services. It uses mDNS and uPnP to scan the network and supports Python 2 and 3. It allows to scan on demand or offer a service that will scan the network in the background in a set interval.

It is the library that powers the device discovery within Home Assistant.

Installation

git clone https://github.com/balloob/netdisco
pip install -r requirements.txt

Use pip3 instead of pip if you're using Python 3.

Example

import time
import netdisco

netdis = netdisco.NetworkDiscovery()

netdis.scan()

for dev in netdis.discover():
    print(dev, netdis.get_info(dev))

netdis.stop()

Will result in a list of discovered devices and their most important information:

DLNA ['https://192.168.1.1:8200/rootDesc.xml', 'https://192.168.1.150:32469/DeviceDescription.xml']
google_cast [('Living Room.local.', 8009)]
philips_hue ['https://192.168.1.2:80/description.xml']
belkin_wemo ['https://192.168.1.10:49153/setup.xml']

About

Python library to scan local network for mDNS and uPnP services and devices.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%