From ba295f1429260e1ffac7205ad3a3e6d3d55bc4b6 Mon Sep 17 00:00:00 2001 From: Goffi Date: Mon, 23 Nov 2015 23:30:41 +0100 Subject: [PATCH] quick_frontend: getFeatures is called on profile plug, and saved in host.features --- frontends/src/quick_frontend/quick_app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/frontends/src/quick_frontend/quick_app.py b/frontends/src/quick_frontend/quick_app.py index ecb952ed..9616590e 100644 --- a/frontends/src/quick_frontend/quick_app.py +++ b/frontends/src/quick_frontend/quick_app.py @@ -79,6 +79,14 @@ class ProfileManager(object): def _plug_profile_afterconnect(self): # Profile can be connected or not # we get cached data + self.host.bridge.getFeatures(profile_key=self.profile, callback=self._plug_profile_getFeaturesCb, errback=self._plug_profile_getFeaturesEb) + + def _plug_profile_getFeaturesEb(self, failure): + log.error(u"Couldn't get features: {}".format(failure)) + self._plug_profile_getFeaturesCb({}) + + def _plug_profile_getFeaturesCb(self, features): + self.host.features = features self.host.bridge.getEntitiesData([], ProfileManager.cache_keys_to_get, profile=self.profile, callback=self._plug_profile_gotCachedValues, errback=self._plug_profile_failedCachedValues) def _plug_profile_failedCachedValues(self, failure): @@ -270,6 +278,7 @@ class QuickApp(object): self.current_action_ids = set() # FIXME: to be removed self.current_action_ids_cb = {} # FIXME: to be removed self.media_dir = self.bridge.getConfig('', 'media_dir') + self.features = None @property def current_profile(self):