diff --git a/homeassistant/components/configurator.py b/homeassistant/components/configurator.py index 3ece10d4d40..2e43e9c54f6 100644 --- a/homeassistant/components/configurator.py +++ b/homeassistant/components/configurator.py @@ -10,9 +10,9 @@ A callback has to be provided to `request_config` which will be called when the user has submitted configuration information. """ import logging -import threading from homeassistant.helpers import generate_entity_id +from homeassistant.const import EVENT_TIME_CHANGED DOMAIN = "configurator" DEPENDENCIES = [] @@ -155,14 +155,17 @@ class Configurator(object): entity_id = self._requests.pop(request_id)[0] + # If we remove the state right away, it will not be included with + # the result fo the service call (current design limitation). + # Instead, we will set it to configured to give as feedback but delete + # it shortly after so that it is deleted when the client updates. self.hass.states.set(entity_id, STATE_CONFIGURED) - # If we remove the state right away, it will not be included with - # the result fo the service call (limitation current design). - # Instead we will set it to configured to give as feedback but delete - # it shortly after so that it is deleted when the client updates. - threading.Timer( - .001, lambda: self.hass.states.remove(entity_id)).start() + def deferred_remove(event): + """ Remove the request state. """ + self.hass.states.remove(entity_id) + + self.hass.bus.listen_once(EVENT_TIME_CHANGED, deferred_remove) def handle_service_call(self, call): """ Handle a configure service call. """ diff --git a/homeassistant/components/http/frontend.py b/homeassistant/components/http/frontend.py index df97ffe708f..efddb978781 100644 --- a/homeassistant/components/http/frontend.py +++ b/homeassistant/components/http/frontend.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "f299ce624d1641191f6f6a9b4b4d05bc" +VERSION = "d44fb74a23d83756ed92d5d55f4d81ea" diff --git a/homeassistant/components/http/www_static/frontend.html b/homeassistant/components/http/www_static/frontend.html index 7129040444c..bf2aebfa5e5 100644 --- a/homeassistant/components/http/www_static/frontend.html +++ b/homeassistant/components/http/www_static/frontend.html @@ -50,7 +50,7 @@ if(this.removeAttribute(a),d)return j(this,a,c);var e=c,f=m(this,a,e);return j(t