screenBloom icon indicating copy to clipboard operation
screenBloom copied to clipboard

Error on startup

Open federicoemartinez opened this issue 6 years ago • 2 comments

unnamed The problem seems to be related to the IP of the Bridge changing. It would be good to catch the error and force a reconfiguration, something like: Cannot contact the bridge, register your bridge again (or maybe perform a new search and reuse the token?)

I could try to create a PR if you agree and if you tell me where I should look.

federicoemartinez avatar Nov 14 '17 13:11 federicoemartinez

Hey there, thanks for bringing this up.

The catch will probably have to go somewhere in here. I'm compiling a list of fixes/small things to add with some free time in the next few weeks, will definitely be investigating this one.

kershner avatar Nov 26 '17 15:11 kershner

I was thinking of something like

try:
                    presets.update_presets_if_necessary()
                except ConnectionError:
                    # There was an error connecting to the hue lights
                    # let's pretend it is a new user
                    self._set_startup_for_new_user()
                    return

with

    def _set_startup_for_new_user(self):
        self.url = self.base_url + 'new-user'
        self.new_user = True

So I don't repeat that code. Did you have something like that in mind?

federicoemartinez avatar Dec 02 '17 16:12 federicoemartinez