Exemple #1
0
 def onNotification(self, sender, method, data):
     xbmclog('In onNotification(sender={}, method={}, data={})'.format(
         sender, method, data))
     if sender == clientinfo.ClientInfo().get_addon_id():
         if 'discover' in method:
             self.ga.sendScreenView("Configurations/Discover")
             self.hue_service.ga.sendEventData("Configurations", "Discover")
             ui.discover_lights(self.hue_service)
             self.hue_service.update_controllers()
         if 'start_setup_theater_lights' in method:
             self.ga.sendScreenView("Configurations/SetupGroup/Theater")
             self.hue_service.ga.sendEventData("Configurations",
                                               "Setup Group", "Theater")
             ret = ui.multiselect_lights(
                 'Select Theater Lights', ','.join([
                     self.hue_service.settings.ambilight_group,
                     self.hue_service.settings.static_group
                 ]), self.hue_service.settings.theater_group)
             self.hue_service.settings.update(theater_group=ret)
             self.hue_service.update_controllers()
         if 'start_setup_theater_subgroup' in method:
             self.ga.sendScreenView(
                 "Configurations/SetupGroup/TheaterSubgroup")
             self.hue_service.ga.sendEventData("Configurations",
                                               "Setup Group",
                                               "Theater Subgroup")
             ret = ui.multiselect_lights(
                 'Select Theater Subgroup', ','.join([
                     self.hue_service.settings.ambilight_group,
                     self.hue_service.settings.static_group
                 ]), self.hue_service.settings.theater_subgroup)
             self.hue_service.settings.update(theater_subgroup=ret)
             self.hue_service.update_controllers()
         if 'start_setup_ambilight_lights' in method:
             self.ga.sendScreenView("Configurations/SetupGroup/Ambilight")
             self.hue_service.ga.sendEventData("Configurations",
                                               "Setup Group", "Ambilight")
             ret = ui.multiselect_lights(
                 'Select Ambilight Lights', ','.join([
                     self.hue_service.settings.theater_group,
                     self.hue_service.settings.static_group
                 ]), self.hue_service.settings.ambilight_group)
             self.hue_service.settings.update(ambilight_group=ret)
             self.hue_service.update_controllers()
         if 'start_setup_static_lights' in method:
             self.ga.sendScreenView("Configurations/SetupGroup/Static")
             self.hue_service.ga.sendEventData("Configurations",
                                               "Setup Group", "Static")
             ret = ui.multiselect_lights(
                 'Select Static Lights', ','.join([
                     self.hue_service.settings.theater_group,
                     self.hue_service.settings.ambilight_group
                 ]), self.hue_service.settings.static_group)
             self.hue_service.settings.update(static_group=ret)
             self.hue_service.update_controllers()
         if 'reset_settings' in method:
             self.ga.sendScreenView("Configurations/Reset")
             self.hue_service.ga.sendEventData("Configurations", "Reset")
             os.unlink(os.path.join(__addondir__, "settings.xml"))
Exemple #2
0
 def onNotification(self, sender, method, data):
     xbmclog('Kodi Hue: In onNotification(sender={}, method={}, data={})'
             .format(sender, method, data))
     if sender == __addon__.getAddonInfo('id'):
         if method == 'Other.start_setup_theater_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Theater Lights',
                 ','.join([self.settings.ambilight_group,
                           self.settings.static_group]),
                 self.settings.theater_group
             )
             self.settings.update(theater_group=ret)
             self.update_controllers()
         if method == 'Other.start_setup_theater_subgroup':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Theater Subgroup',
                 ','.join([self.settings.ambilight_group,
                           self.settings.static_group]),
                 self.settings.theater_subgroup
             )
             self.settings.update(theater_subgroup=ret)
             self.update_controllers()
         if method == 'Other.start_setup_ambilight_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Ambilight Lights',
                 ','.join([self.settings.theater_group,
                           self.settings.static_group]),
                 self.settings.ambilight_group
             )
             self.settings.update(ambilight_group=ret)
             self.update_controllers()
         if method == 'Other.start_setup_static_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Static Lights',
                 ','.join([self.settings.theater_group,
                           self.settings.ambilight_group]),
                 self.settings.static_group
             )
             self.settings.update(static_group=ret)
             self.update_controllers()
 def onNotification(self, sender, method, data):
     xbmclog('Kodi Hue: In onNotification(sender={}, method={}, data={})'
             .format(sender, method, data))
     if sender == __addon__.getAddonInfo('id'):
         if method == 'Other.start_setup_theater_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Theater Lights',
                 ','.join([self.settings.ambilight_group,
                           self.settings.static_group]),
                 self.settings.theater_group
             )
             self.settings.update(theater_group=ret)
             hue.update_controllers()
         if method == 'Other.start_setup_theater_subgroup':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Theater Subgroup',
                 ','.join([self.settings.ambilight_group,
                           self.settings.static_group]),
                 self.settings.theater_subgroup
             )
             self.settings.update(theater_subgroup=ret)
             hue.update_controllers()
         if method == 'Other.start_setup_ambilight_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Ambilight Lights',
                 ','.join([self.settings.theater_group,
                           self.settings.static_group]),
                 self.settings.ambilight_group
             )
             self.settings.update(ambilight_group=ret)
             hue.update_controllers()
         if method == 'Other.start_setup_static_lights':
             ret = ui.multiselect_lights(
                 self.settings.bridge_ip,
                 self.settings.bridge_user,
                 'Select Static Lights',
                 ','.join([self.settings.theater_group,
                           self.settings.ambilight_group]),
                 self.settings.static_group
             )
             self.settings.update(static_group=ret)
             hue.update_controllers()