home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.61k stars 29.92k forks source link

Litter Robot API Authentication Failure #53120

Closed MikeExMachina closed 3 years ago

MikeExMachina commented 3 years ago

The problem

The integration appears to be failing to correctly parse some message during the authentication process. I removed the actual account email in the log below but I verified that the credentials are correct and work with the LR app. It was working just fine on core-2021.6.something, then just seemed to randomly stop. Updated to latest core-2021.7.3, no luck. Removed integration and re-added, still getting error.

What is version of Home Assistant Core has the issue?

core-2021.7.3

What was the last working version of Home Assistant Core?

core-2021.6.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

LitterRobot

Link to integration documentation on our website

https://www.home-assistant.io/integrations/litterrobot/

Example YAML snippet

N/A

Anything in the logs that might be useful for us?

Error setting up entry user@domain.tld for litterrobot
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/litterrobot/__init__.py", line 20, in async_setup_entry
    await hub.login(load_robots=True)
  File "/usr/src/homeassistant/homeassistant/components/litterrobot/hub.py", line 46, in login
    await self.account.connect(
  File "/usr/local/lib/python3.9/site-packages/pylitterbot/account.py", line 52, in connect
    await self.refresh_robots()
  File "/usr/local/lib/python3.9/site-packages/pylitterbot/account.py", line 86, in refresh_robots
    robot_object = Robot(
  File "/usr/local/lib/python3.9/site-packages/pylitterbot/robot.py", line 92, in __init__
    self._update_data(data)
  File "/usr/local/lib/python3.9/site-packages/pylitterbot/robot.py", line 323, in _update_data
    self._parse_sleep_info()
  File "/usr/local/lib/python3.9/site-packages/pylitterbot/robot.py", line 343, in _parse_sleep_info
    [hours, minutes, seconds] = list(map(int, sleep_mode_active[1:].split(":")))
ValueError: invalid literal for int() with base 10: '7F'

Additional information

N/A

probot-home-assistant[bot] commented 3 years ago

litterrobot documentation litterrobot source (message by IssueLinks)

probot-home-assistant[bot] commented 3 years ago

Hey there @natekspencer, mind taking a look at this issue as its been labeled with an integration (litterrobot) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

natekspencer commented 3 years ago

@MikeExMachina, this looks to be an issue with parsing the sleep mode time. Are you still having the issue? I've used the old and new Litter-Robot apps on both iOS and android to enable/disable/set sleep mode and never come across a non-numeric in the sleep mode data from the API. As such, I'm curious what you used to set sleep mode for your unit that resulted in this.

I'll add a try/catch around that particular piece so it will prevent future issues however.

frenck commented 3 years ago

Fixed in #53254