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

Discussion: DustbinStates.full is translated to state ERROR which might be misleading #58

Open
Phype opened this issue Nov 29, 2023 · 2 comments
Labels
discussion Ticket containing mostly discussions

Comments

@Phype
Copy link
Contributor

Phype commented Nov 29, 2023

This is more a discussion piece than an actual issue.

For me as a user - which might possibly ignore the robots request to empty the dustbin from time to time (🙈) - it is kind of misleading that homeassistant will report a full dustbin as state ERROR, as the robot is technically still operational - albeit with obviously reduced cleaning performance.

I'm bringing this up mainly because it makes it hard to distinguish between states which need immidiate action - ie. the robot getting stuck somewhere - and states which are less problematic - such as a full dustbin.

What do you think? I guess it would be best to have a seperate state, but HA does not support this. Maybe i just have to create a custom UI which differentiates based on the attribute.

@Phype Phype changed the title Discussion: DustbinStates.ful is translated to state ERROR which might be misleading Discussion: DustbinStates.full is translated to state ERROR which might be misleading Nov 29, 2023
@Phype
Copy link
Contributor Author

Phype commented Nov 29, 2023

For reference: This is the current implementation:

https://github.com/Ekman/home-assistant-pure-i9/blob/master/custom_components/purei9/purei9.py#L48

def state_to_hass(
    pure_i9_state: str,
    pure_i9_battery: str,
    purei9_dustbin: DustbinStates=DustbinStates.connected
    ) -> str:
    """Translate Pure i9 data into a Home Assistant state constant"""
    # The Pure i9 will become "Sleeping" when docked and charged 100% OR when stopped.
    # In order to detect if it's docket or if it's just idling in the middle of a room
    # check the battery level. If it's full then we're docked.
    if purei9_dustbin in (DustbinStates.empty, DustbinStates.full):
        return STATE_ERROR

    if pure_i9_state == RobotStates.Sleeping:
        return STATE_DOCKED if pure_i9_battery == BatteryStatus.High else STATE_IDLE

    return PURE_I9_STATE_MAP.get(pure_i9_state, STATE_IDLE)

@Ekman
Copy link
Owner

Ekman commented Feb 29, 2024

Thanks for the request! I get your point and maybe I was a bit quick when I implemented a full dustbin as an error. I'm a bit reluctant to change it though since I'm a strong believer in semantic versioning and, technically, this would be a breaking change.

I'm going to leave this open and I want people that agree to vote with a thumbs up on the original post. If more people feel the same way I'll look into changing it.

How does that sound?

@Ekman Ekman added the discussion Ticket containing mostly discussions label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Ticket containing mostly discussions
Projects
None yet
Development

No branches or pull requests

2 participants