From 6adc5c318ec2d3d2dcb561e40e4a2b6fd324566c Mon Sep 17 00:00:00 2001
From: Jan Harkes <jaharkes@cs.cmu.edu>
Date: Wed, 25 Jan 2017 00:29:34 -0500
Subject: [PATCH] Add missing dependency in emulated_hue component. (#5394)

* Add missing dependency in emulated_hue component.

On first startup after upgrade to 0.36, the emulated_hue componented failed to
start because the http component had installed the modules it depends on, in
this particular case 'aiohttp_cors' was missing.

* Include dependencies for the emulated_hue web server

Emulated_hue uses it's own 'web-server' component to handle hue related
discovery and config, so we need to make sure the required http modules are
made available before we are initialized.

We don't have to depend on the home-assistant http/api component because we do
not need to have the frontend to be initialized to handle emulated_hue, so we
can just import in the same set of requirements as the http component.

* Fix linting error
---
 homeassistant/components/emulated_hue/__init__.py | 1 +
 requirements_all.txt                              | 1 +
 2 files changed, 2 insertions(+)

diff --git a/homeassistant/components/emulated_hue/__init__.py b/homeassistant/components/emulated_hue/__init__.py
index 038c50173f5..5d6d6d0e61d 100644
--- a/homeassistant/components/emulated_hue/__init__.py
+++ b/homeassistant/components/emulated_hue/__init__.py
@@ -14,6 +14,7 @@ from homeassistant import util
 from homeassistant.const import (
     EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STOP,
 )
+from homeassistant.components.http import REQUIREMENTS  # NOQA
 from homeassistant.components.http import HomeAssistantWSGI
 import homeassistant.helpers.config_validation as cv
 from .hue_api import (
diff --git a/requirements_all.txt b/requirements_all.txt
index 34037293a3b..cd47bf80753 100755
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -33,6 +33,7 @@ SoCo==0.12
 # homeassistant.components.notify.twitter
 TwitterAPI==2.4.3
 
+# homeassistant.components.emulated_hue
 # homeassistant.components.http
 aiohttp_cors==0.5.0
 
-- 
GitLab