Conversation
* Handle Hue errors better * Lint
| self.host, | ||
| config_file_path=self.hass.config.path(self.filename)) | ||
| except ConnectionRefusedError: # Wrong host was given | ||
| except (ConnectionRefusedError, OSError): # Wrong host was given |
There was a problem hiding this comment.
ConnectionRefusedError is a subclass of OSError.
There was a problem hiding this comment.
Oh.
Well good thing that I am going to throw it all away when we migrate to aiohue #12830
There was a problem hiding this comment.
I tested it locally before committing but only tested
>>> isinstance(ConnectionRefusedError, OSError)
False
But classes are of type Type.
Instantiating did the trick:
>>> isinstance(ConnectionRefusedError(), OSError)
True
|
After recent update error still there fyi |
| except Exception: # pylint: disable=broad-except | ||
| _LOGGER.exception("Unknown error connecting with Hue bridge at %s", | ||
| self.host) | ||
|
|
There was a problem hiding this comment.
We should probably return here.
There was a problem hiding this comment.
Good point. Will include it in my #12830 branch
|
@robertw so it looks like your Philips Hue hub is not returning JSON. Could you update |
|
i would love to but i am running hass.io so i have no clue unless you can walk me through..... |
|
Ah yes, that won't work :/ |
Description:
If a user has 2 networks behind the same IP with both a Hue hub, Hue component would fail to setup.
What would happen is that Home Assistant would get the IP address from the cloud discovery and try to connect. This would raise an OSError and we only handled ConnectionRefusedError. I've also added a generic exception handler to make sure we don't disturb the setup process of other hubs.
Example entry for
configuration.yaml(if applicable):hue: