Move setup_url_for_address to pyWeMo library (#42722)

* Move setup_url_for_address to PyWemo library

* Bump pywemo to 0.5.2

* Use module-level function call

* Update requirements via script
pull/43123/head
Joshua M. Boniface 2020-11-12 00:37:27 -05:00 committed by GitHub
parent 8a0907acf9
commit be93060e99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 14 deletions

View File

@ -164,7 +164,7 @@ async def async_setup_entry(hass, entry):
def validate_static_config(host, port): def validate_static_config(host, port):
"""Handle a static config.""" """Handle a static config."""
url = setup_url_for_address(host, port) url = pywemo.setup_url_for_address(host, port)
if not url: if not url:
_LOGGER.error( _LOGGER.error(
@ -183,14 +183,3 @@ def validate_static_config(host, port):
return None return None
return device return device
def setup_url_for_address(host, port):
"""Determine setup.xml url for given host and port pair."""
if not port:
port = pywemo.ouimeaux_device.probe_wemo(host)
if not port:
return None
return f"http://{host}:{port}/setup.xml"

View File

@ -3,7 +3,7 @@
"name": "Belkin WeMo", "name": "Belkin WeMo",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/wemo", "documentation": "https://www.home-assistant.io/integrations/wemo",
"requirements": ["pywemo==0.5.0"], "requirements": ["pywemo==0.5.2"],
"ssdp": [ "ssdp": [
{ {
"manufacturer": "Belkin International Inc." "manufacturer": "Belkin International Inc."

View File

@ -1891,7 +1891,7 @@ pyvolumio==0.1.3
pywebpush==1.9.2 pywebpush==1.9.2
# homeassistant.components.wemo # homeassistant.components.wemo
pywemo==0.5.0 pywemo==0.5.2
# homeassistant.components.wilight # homeassistant.components.wilight
pywilight==0.0.65 pywilight==0.0.65