Skip to content
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

Open
Santobert opened this issue Oct 11, 2019 · 4 comments
Open

Mark robot unavailable and make available when turned on #19

Santobert opened this issue Oct 11, 2019 · 4 comments

Comments

@Santobert
Copy link

Santobert commented Oct 11, 2019

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.).

@Santobert
Copy link
Author

Santobert commented Oct 11, 2019

We have to catch the error here and mark this robot as offline: https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/robot.py#L231

@dshokouhi
Copy link
Owner

We catch all the errors here: https://github.com/stianaske/pybotvac/blob/fec807d15fe3419bbd7c8c950213682e00bd52c0/pybotvac/robot.py#L67

all robot messages pass through here

@Santobert
Copy link
Author

Santobert commented Oct 11, 2019

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.

@dshokouhi
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants