Skip to content

Conversation

@Lash-L
Copy link
Collaborator

@Lash-L Lash-L commented Feb 22, 2023

Getting an integration approved in HA is complicated. The larger the PR, the less likely it will be to be reviewed at any time soon.

So I moved the code mappings to the api to decrease the file size of vacuum.py.

We don't have to do this if you are against this.

This is a breaking change for the hacs integration. unless I make the same changes over there.

Let me know your thoughts.


@property
def status(self) -> str:
return STATE_CODE_TO_STATUS.get(self.state, f"Unknown Status {self.state}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be handled in another way. Returning a free text instead of the status itself looks bad. There are already attribute like state, error_code and the new ones you added handling the raw value

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you prefer? returning the state_code like before and just handling the get on the frontend like before? Perfectly fine with whatever you would like to do, just let me know.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Just returning str mapping or None as before, and let whoever is using the data deal with it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, changed!

@humbertogontijo humbertogontijo merged commit 2fdfe1d into Python-roborock:main Mar 1, 2023
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