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

Remove "Turn On" when robot is idle #210

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

sh00t2kill
Copy link
Owner

The integration automatically sets the state of the vacuum to off when its not actively cleaning and it is unable to calculate another state.

When HA sees a state of off, it automatically adds a TURN ON button, instead of START CLEANING.
Changing the default state to idle addresses this.

@sh00t2kill sh00t2kill requested a review from elad-bar June 30, 2024 01:27
@elad-bar
Copy link
Collaborator

hi, sorry for all comments below :)

there are 16 places in code that relaying on off state that you changed in calculated state,
in addition, the idle (new state) should have more impact than just sensor state,
it should allow or not, whether you can move to another state (clean mode, pickup, etc...),
to make sure it works perfectly you will need to:

  1. run tests in indicators_test.py
  2. run manual test of all state transition by HA

last thing, as result of that change there will be functions that will not get called, so they should be cleaned as well

@elad-bar
Copy link
Collaborator

adding list of code lines related to pws_state_off:
image

@sh00t2kill
Copy link
Owner Author

sh00t2kill commented Jun 30, 2024

I did a bunch of manual testing, it worked as expected.

A lot of the spots you highlighted are the tests themselves, or the actual state of the base station.

@elad-bar
Copy link
Collaborator

elad-bar commented Jul 2, 2024

if the mapping of actions (ACTION_ENTITY_TURN_ON, ACTION_ENTITY_TURN_OFF) in coordinator was removed,
the corresponding action should be removed (_vacuum_turn_on, _vacuum_turn_off).

in case the vacuum doesn't support turn on/off, it will not support toggle, therefore mapping ACTION_ENTITY_TOGGLE should be removed with its function _vacuum_toggle.

the problem that might get created and relevant not for ui but for the aws reporting status is CONSIDERED_POWER_STATE,
up until now, PWS_STATE_OFF and PWS_STATE_ERROR reported it off, if you are removing the off state, the aws status reporting needs to use another variable or that variable should be set by something else with the fact whether the robot should be treated as on/off.

not sure whether you tested it with logs in debug mode to see how things are working and whether all state changes are working - set as one mode, change to another, pause, resume, double resume, double pause, pickup when running, when idle.

@sh00t2kill
Copy link
Owner Author

sh00t2kill commented Jul 2, 2024

I didn't test everything, but I tested the main functions and everything seemed as expected.

I left those functions in just in case something else is using them.

Unfortunately I'm away on holiday for the next 4 weeks so feel free to reject this and work on it, but at least I found the cause of why turn on appears!

@elad-bar
Copy link
Collaborator

elad-bar commented Jul 2, 2024

Will try to get to it this weekend and take this branch and add the additional items i wrote

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

Successfully merging this pull request may close these issues.

2 participants