diff --git a/homeassistant/components/configurator.py b/homeassistant/components/configurator.py index 9f5cb397587..d205b45e446 100644 --- a/homeassistant/components/configurator.py +++ b/homeassistant/components/configurator.py @@ -8,7 +8,8 @@ the user has submitted configuration information. """ import logging -from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME +from homeassistant.const import EVENT_TIME_CHANGED, ATTR_FRIENDLY_NAME, \ + ATTR_ENTITY_PICTURE from homeassistant.helpers.entity import generate_entity_id _INSTANCES = {} @@ -36,7 +37,8 @@ STATE_CONFIGURED = 'configured' # pylint: disable=too-many-arguments def request_config( hass, name, callback, description=None, description_image=None, - submit_caption=None, fields=None, link_name=None, link_url=None): + submit_caption=None, fields=None, link_name=None, link_url=None, + entity_picture=None): """Create a new request for configuration. Will return an ID to be used for sequent calls. @@ -46,7 +48,7 @@ def request_config( request_id = instance.request_config( name, callback, description, description_image, submit_caption, - fields, link_name, link_url) + fields, link_name, link_url, entity_picture) _REQUESTS[request_id] = instance @@ -104,7 +106,7 @@ class Configurator(object): def request_config( self, name, callback, description, description_image, submit_caption, - fields, link_name, link_url): + fields, link_name, link_url, entity_picture): """Setup a request for configuration.""" entity_id = generate_entity_id(ENTITY_ID_FORMAT, name, hass=self.hass) @@ -119,6 +121,7 @@ class Configurator(object): ATTR_CONFIGURE_ID: request_id, ATTR_FIELDS: fields, ATTR_FRIENDLY_NAME: name, + ATTR_ENTITY_PICTURE: entity_picture, } data.update({ diff --git a/homeassistant/components/frontend/www_static/images/logo_philips_hue.png b/homeassistant/components/frontend/www_static/images/logo_philips_hue.png new file mode 100644 index 00000000000..ae4df811fa8 Binary files /dev/null and b/homeassistant/components/frontend/www_static/images/logo_philips_hue.png differ diff --git a/homeassistant/components/frontend/www_static/images/config_plex_mediaserver.png b/homeassistant/components/frontend/www_static/images/logo_plex_mediaserver.png similarity index 100% rename from homeassistant/components/frontend/www_static/images/config_plex_mediaserver.png rename to homeassistant/components/frontend/www_static/images/logo_plex_mediaserver.png diff --git a/homeassistant/components/light/hue.py b/homeassistant/components/light/hue.py index ce2ae7b54f7..46ba1099ef7 100644 --- a/homeassistant/components/light/hue.py +++ b/homeassistant/components/light/hue.py @@ -190,6 +190,7 @@ def request_configuration(host, hass, add_devices, filename, hass, "Philips Hue", hue_configuration_callback, description=("Press the button on the bridge to register Philips Hue " "with Home Assistant."), + entity_picture="/static/images/logo_philips_hue.png", description_image="/static/images/config_philips_hue.jpg", submit_caption="I have pressed the button" ) diff --git a/homeassistant/components/media_player/plex.py b/homeassistant/components/media_player/plex.py index 29d332646bb..aac38180f94 100644 --- a/homeassistant/components/media_player/plex.py +++ b/homeassistant/components/media_player/plex.py @@ -183,7 +183,7 @@ def request_configuration(host, hass, add_devices_callback): _CONFIGURING[host] = configurator.request_config( hass, 'Plex Media Server', plex_configuration_callback, description=('Enter the X-Plex-Token'), - description_image='/static/images/config_plex_mediaserver.png', + entity_picture='/static/images/logo_plex_mediaserver.png', submit_caption='Confirm', fields=[{'id': 'token', 'name': 'X-Plex-Token', 'type': ''}] ) diff --git a/tests/components/test_configurator.py b/tests/components/test_configurator.py index 100c0a9ce2a..72c0de358ce 100644 --- a/tests/components/test_configurator.py +++ b/tests/components/test_configurator.py @@ -46,10 +46,20 @@ class TestConfigurator(unittest.TestCase): configurator.ATTR_DESCRIPTION_IMAGE: "config image url", configurator.ATTR_SUBMIT_CAPTION: "config submit caption", configurator.ATTR_FIELDS: [], + configurator.ATTR_LINK_NAME: "link name", + configurator.ATTR_LINK_URL: "link url", + configurator.ATTR_ENTITY_PICTURE: "config entity picture", configurator.ATTR_CONFIGURE_ID: configurator.request_config( - self.hass, "Test Request", lambda _: None, - "config description", "config image url", - "config submit caption" + self.hass, + name="Test Request", + callback=lambda _: None, + description="config description", + description_image="config image url", + submit_caption="config submit caption", + fields=None, + link_name="link name", + link_url="link url", + entity_picture="config entity picture", ) }