-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mark robot unavailable and make available when turned on #19
Comments
We have to catch the error here and mark this robot as offline: https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/robot.py#L231 |
We catch all the errors here: https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/robot.py#L67 all robot messages pass through here |
Yes, you're right. So we need to catch the NeatoRobotException here: https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/robot.py#L231 After that we have to return a valid state object containing the information that the robot is offline. |
So I wonder if this is now resolved with: https://github.com/home-assistant/core/blob/dev/homeassistant/components/neato/__init__.py#L106 Because if one of the robots is offline then the call should fail and HA will try to reconnect once online. I did not test this theory but it sounds like it may be solved. We already handle when device goes offline when HA has already been started so I think this now covers the scenario where device is offline when HA starts up. |
This is not possible with the current version of pybotvac.
https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/account.py#L124
This line above only adds robots that are currently available. This way, Home Assistant never knows that a robot that is currently unavailable even exists. We have to change the behavior of pybotvac so that it also adds robots that are offline and marks them as offline.
We should also mark robots that are currently offline with PlatformNotReady. We should raise this exception also for all associated platforms (sensor, camera, etc.).
The text was updated successfully, but these errors were encountered: