From 16e1b3772c87ea48ea598d9bc73a89116c096f29 Mon Sep 17 00:00:00 2001 From: ochlocracy <5885236+ochlocracy@users.noreply.github.com> Date: Tue, 21 Apr 2020 13:46:56 -0400 Subject: [PATCH] Modify requirements for CameraStreamController in Alexa (#34470) --- homeassistant/components/alexa/entities.py | 11 +++++------ tests/components/alexa/test_smart_home.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/alexa/entities.py b/homeassistant/components/alexa/entities.py index fce05c8dc86..d4676344a62 100644 --- a/homeassistant/components/alexa/entities.py +++ b/homeassistant/components/alexa/entities.py @@ -791,19 +791,18 @@ class CameraCapabilities(AlexaEntity): yield Alexa(self.hass) def _check_requirements(self): - """Check the hass URL for HTTPS scheme and port 443.""" + """Check the hass URL for HTTPS scheme.""" if "stream" not in self.hass.config.components: - _LOGGER.error( + _LOGGER.debug( "%s requires stream component for AlexaCameraStreamController", self.entity_id, ) return False url = urlparse(network.async_get_external_url(self.hass)) - if url.scheme != "https" or (url.port is not None and url.port != 443): - _LOGGER.error( - "%s requires HTTPS support on port 443 for AlexaCameraStreamController", - self.entity_id, + if url.scheme != "https": + _LOGGER.debug( + "%s requires HTTPS for AlexaCameraStreamController", self.entity_id ) return False diff --git a/tests/components/alexa/test_smart_home.py b/tests/components/alexa/test_smart_home.py index a0d40460373..293727b4294 100644 --- a/tests/components/alexa/test_smart_home.py +++ b/tests/components/alexa/test_smart_home.py @@ -3806,9 +3806,9 @@ async def test_camera_discovery_without_stream(hass): "url,result", [ ("http://nohttpswrongport.org:8123", 2), - ("https://httpswrongport.org:8123", 2), ("http://nohttpsport443.org:443", 2), ("tls://nohttpsport443.org:443", 2), + ("https://httpsnnonstandport.org:8123", 3), ("https://correctschemaandport.org:443", 3), ("https://correctschemaandport.org", 3), ],