quick_frontend: getFeatures is called on profile plug, and saved in host.features

This commit is contained in:
Goffi 2015-11-23 23:30:41 +01:00
commit ba295f1429

View file

@ -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):