Ejemplo n.º 1
0
    def _select_bridge(self, index):
        bridge = self._bridges[index]
        self._settings.setValue('selected_bridge', index)
        self._manager = DiscoBall(bridge['value'])

        try:
            self._lights = self._manager.get_light_list()
            self.lightsList.clear()
            for light in self._lights:
                self.lightsList.addItem(light['value'])
            self._select_light(0)

        except BridgeNotRegisteredException as e:
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Icon.Warning)
            msg.setText(
                "This application is not registered with this Hue Bridge")
            msg.setInformativeText(
                "Please press the register button on top of the bridge and click the retry button"
            )
            msg.setWindowTitle("Error")
            msg.show()
Ejemplo n.º 2
0
 def dialog_critical(self, s):
     dlg = QMessageBox(self)
     dlg.setText(s)
     dlg.setIcon(QMessageBox.Critical)
     dlg.show()