mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-11-07 01:52:11 +00:00
Initial Configuration Push
This commit is contained in:
20
deps/netdisco/discoverables/netgear_router.py
vendored
Normal file
20
deps/netdisco/discoverables/netgear_router.py
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"""Discover Netgear routers."""
|
||||
from netdisco.util import urlparse
|
||||
from . import SSDPDiscoverable
|
||||
|
||||
|
||||
class Discoverable(SSDPDiscoverable):
|
||||
"""Add support for discovering Netgear routers."""
|
||||
|
||||
def info_from_entry(self, entry):
|
||||
"""Return the most important info from a uPnP entry."""
|
||||
url = urlparse(entry.values['location'])
|
||||
|
||||
return (entry.description['device']['modelNumber'], url.hostname)
|
||||
|
||||
def get_entries(self):
|
||||
"""Get all the Netgear uPnP entries."""
|
||||
return self.find_by_device_description({
|
||||
"manufacturer": "NETGEAR, Inc.",
|
||||
"deviceType": "urn:schemas-upnp-org:device:InternetGatewayDevice:1"
|
||||
})
|
||||
Reference in New Issue
Block a user