mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Port netdisco from external to requirements.txt
This commit is contained in:
parent
43cc3624ee
commit
3efb1e4ac9
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,9 +1,6 @@
|
|||||||
[submodule "homeassistant/external/pywemo"]
|
[submodule "homeassistant/external/pywemo"]
|
||||||
path = homeassistant/external/pywemo
|
path = homeassistant/external/pywemo
|
||||||
url = https://github.com/balloob/pywemo.git
|
url = https://github.com/balloob/pywemo.git
|
||||||
[submodule "homeassistant/external/netdisco"]
|
|
||||||
path = homeassistant/external/netdisco
|
|
||||||
url = https://github.com/balloob/netdisco.git
|
|
||||||
[submodule "homeassistant/external/noop"]
|
[submodule "homeassistant/external/noop"]
|
||||||
path = homeassistant/external/noop
|
path = homeassistant/external/noop
|
||||||
url = https://github.com/balloob/noop.git
|
url = https://github.com/balloob/noop.git
|
||||||
|
@ -12,9 +12,6 @@ loaded before the EVENT_PLATFORM_DISCOVERED is fired.
|
|||||||
import logging
|
import logging
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
# pylint: disable=no-name-in-module, import-error
|
|
||||||
import homeassistant.external.netdisco.netdisco.const as services
|
|
||||||
|
|
||||||
from homeassistant import bootstrap
|
from homeassistant import bootstrap
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
EVENT_HOMEASSISTANT_START, EVENT_PLATFORM_DISCOVERED,
|
EVENT_HOMEASSISTANT_START, EVENT_PLATFORM_DISCOVERED,
|
||||||
@ -22,14 +19,20 @@ from homeassistant.const import (
|
|||||||
|
|
||||||
DOMAIN = "discovery"
|
DOMAIN = "discovery"
|
||||||
DEPENDENCIES = []
|
DEPENDENCIES = []
|
||||||
REQUIREMENTS = ['zeroconf>=0.16.0']
|
REQUIREMENTS = ['netdisco>=0.1']
|
||||||
|
|
||||||
SCAN_INTERVAL = 300 # seconds
|
SCAN_INTERVAL = 300 # seconds
|
||||||
|
|
||||||
|
# Next 3 lines for now a mirror from netdisco.const
|
||||||
|
# Should setup a mapping netdisco.const -> own constants
|
||||||
|
SERVICE_WEMO = 'belkin_wemo'
|
||||||
|
SERVICE_HUE = 'philips_hue'
|
||||||
|
SERVICE_CAST = 'google_cast'
|
||||||
|
|
||||||
SERVICE_HANDLERS = {
|
SERVICE_HANDLERS = {
|
||||||
services.BELKIN_WEMO: "switch",
|
SERVICE_WEMO: "switch",
|
||||||
services.GOOGLE_CAST: "media_player",
|
SERVICE_CAST: "media_player",
|
||||||
services.PHILIPS_HUE: "light",
|
SERVICE_HUE: "light",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -56,14 +59,7 @@ def setup(hass, config):
|
|||||||
""" Starts a discovery service. """
|
""" Starts a discovery service. """
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
try:
|
from netdisco.service import DiscoveryService
|
||||||
from homeassistant.external.netdisco.netdisco.service import \
|
|
||||||
DiscoveryService
|
|
||||||
except ImportError:
|
|
||||||
logger.exception(
|
|
||||||
"Unable to import netdisco. "
|
|
||||||
"Did you install all the zeroconf dependency?")
|
|
||||||
return False
|
|
||||||
|
|
||||||
# Disable zeroconf logging, it spams
|
# Disable zeroconf logging, it spams
|
||||||
logging.getLogger('zeroconf').setLevel(logging.CRITICAL)
|
logging.getLogger('zeroconf').setLevel(logging.CRITICAL)
|
||||||
|
@ -99,7 +99,7 @@ LIGHT_PROFILES_FILE = "light_profiles.csv"
|
|||||||
DISCOVERY_PLATFORMS = {
|
DISCOVERY_PLATFORMS = {
|
||||||
wink.DISCOVER_LIGHTS: 'wink',
|
wink.DISCOVER_LIGHTS: 'wink',
|
||||||
isy994.DISCOVER_LIGHTS: 'isy994',
|
isy994.DISCOVER_LIGHTS: 'isy994',
|
||||||
discovery.services.PHILIPS_HUE: 'hue',
|
discovery.SERVICE_HUE: 'hue',
|
||||||
}
|
}
|
||||||
|
|
||||||
PROP_TO_ATTR = {
|
PROP_TO_ATTR = {
|
||||||
|
@ -24,7 +24,7 @@ SCAN_INTERVAL = 30
|
|||||||
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
ENTITY_ID_FORMAT = DOMAIN + '.{}'
|
||||||
|
|
||||||
DISCOVERY_PLATFORMS = {
|
DISCOVERY_PLATFORMS = {
|
||||||
discovery.services.GOOGLE_CAST: 'cast',
|
discovery.SERVICE_CAST: 'cast',
|
||||||
}
|
}
|
||||||
|
|
||||||
SERVICE_YOUTUBE_VIDEO = 'play_youtube_video'
|
SERVICE_YOUTUBE_VIDEO = 'play_youtube_video'
|
||||||
|
@ -29,7 +29,7 @@ MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
|
|||||||
|
|
||||||
# Maps discovered services to their platforms
|
# Maps discovered services to their platforms
|
||||||
DISCOVERY_PLATFORMS = {
|
DISCOVERY_PLATFORMS = {
|
||||||
discovery.services.BELKIN_WEMO: 'wemo',
|
discovery.SERVICE_WEMO: 'wemo',
|
||||||
wink.DISCOVER_SWITCHES: 'wink',
|
wink.DISCOVER_SWITCHES: 'wink',
|
||||||
isy994.DISCOVER_SWITCHES: 'isy994',
|
isy994.DISCOVER_SWITCHES: 'isy994',
|
||||||
}
|
}
|
||||||
|
1
homeassistant/external/netdisco
vendored
1
homeassistant/external/netdisco
vendored
@ -1 +0,0 @@
|
|||||||
Subproject commit b2cad7c2b959efa8eee9b5ac62d87232bf0b5176
|
|
@ -5,9 +5,6 @@ pytz>=2015.2
|
|||||||
|
|
||||||
# Optional, needed for specific components
|
# Optional, needed for specific components
|
||||||
|
|
||||||
# Discovery platform (discovery)
|
|
||||||
zeroconf>=0.16.0
|
|
||||||
|
|
||||||
# Sun (sun)
|
# Sun (sun)
|
||||||
astral>=0.8.1
|
astral>=0.8.1
|
||||||
|
|
||||||
@ -82,3 +79,6 @@ https://github.com/theolind/pymysensors/archive/master.zip#egg=pymysensors-0.1
|
|||||||
|
|
||||||
# Netgear (device_tracker.netgear)
|
# Netgear (device_tracker.netgear)
|
||||||
pynetgear>=0.1
|
pynetgear>=0.1
|
||||||
|
|
||||||
|
# Netdisco (discovery)
|
||||||
|
netdisco>=0.1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user