From 3ed6be5b4e898e7d92261313aaae37f8772c88ec Mon Sep 17 00:00:00 2001 From: mnestor Date: Sun, 15 May 2016 15:56:29 -0400 Subject: [PATCH] add link ability to configurator (#2035) --- homeassistant/components/configurator.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/configurator.py b/homeassistant/components/configurator.py index aecaa1cfadc..8705f9ce077 100644 --- a/homeassistant/components/configurator.py +++ b/homeassistant/components/configurator.py @@ -19,6 +19,8 @@ SERVICE_CONFIGURE = "configure" STATE_CONFIGURE = "configure" STATE_CONFIGURED = "configured" +ATTR_LINK_NAME = "link_name" +ATTR_LINK_URL = "link_url" ATTR_CONFIGURE_ID = "configure_id" ATTR_DESCRIPTION = "description" ATTR_DESCRIPTION_IMAGE = "description_image" @@ -34,7 +36,7 @@ _LOGGER = logging.getLogger(__name__) # pylint: disable=too-many-arguments def request_config( hass, name, callback, description=None, description_image=None, - submit_caption=None, fields=None): + submit_caption=None, fields=None, link_name=None, link_url=None): """Create a new request for configuration. Will return an ID to be used for sequent calls. @@ -43,7 +45,8 @@ def request_config( request_id = instance.request_config( name, callback, - description, description_image, submit_caption, fields) + description, description_image, submit_caption, + fields, link_name, link_url) _REQUESTS[request_id] = instance @@ -100,7 +103,8 @@ class Configurator(object): # pylint: disable=too-many-arguments def request_config( self, name, callback, - description, description_image, submit_caption, fields): + description, description_image, submit_caption, + fields, link_name, link_url): """Setup a request for configuration.""" entity_id = generate_entity_id(ENTITY_ID_FORMAT, name, hass=self.hass) @@ -121,6 +125,8 @@ class Configurator(object): (ATTR_DESCRIPTION, description), (ATTR_DESCRIPTION_IMAGE, description_image), (ATTR_SUBMIT_CAPTION, submit_caption), + (ATTR_LINK_NAME, link_name), + (ATTR_LINK_URL, link_url), ] if value is not None })