changeset 1655:ad2ad28b8923

quick_frontend: getFeatures is called on profile plug, and saved in host.features
author Goffi <goffi@goffi.org>
date Mon, 23 Nov 2015 23:30:41 +0100
parents 22a8e770cb7b
children 069abd15354f
files frontends/src/quick_frontend/quick_app.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_app.py	Mon Nov 23 23:30:41 2015 +0100
+++ b/frontends/src/quick_frontend/quick_app.py	Mon Nov 23 23:30:41 2015 +0100
@@ -79,6 +79,14 @@
     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 @@
         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):