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

RoombaInfo capabilities values can be null #281

Closed
kiasyn opened this issue Mar 7, 2024 · 2 comments · Fixed by #293
Closed

RoombaInfo capabilities values can be null #281

kiasyn opened this issue Mar 7, 2024 · 2 comments · Fixed by #293

Comments

@kiasyn
Copy link

kiasyn commented Mar 7, 2024

Just went through this getting homeassistant to detect my roomba (it is using an older version of roombapy, but I think it still applies to the current version).

Here are the capabilities I'm getting back from my i2 Roomba. (see pmaps and mc)

"cap": {
	"binFullDetect": 2,
	"addOnHw": 1,
	"oMode": 2,
	"dockComm": 1,
	"edge": 0,
	"maps": 2,
	"pmaps": null,
	"mc": null,
	"tLine": 2,
	"area": 1,
	"eco": 1,
	"multiPass": 3,
	"team": 1,
	"pp": 0,
	"lang": 2,
	"5ghz": 0,
	"prov": 3,
	"sched": 1,
	"svcConf": 1,
	"ota": 2,
	"log": 2,
	"langOta": 2
}

This was ultimately resulting in a 'Socket timeout' but actually it was failing to parse the dictionary with the null value.
In the homeassistant version I patched it with
from typing import Optional
and replacing the definition for capabilities with
capabilities: dict[str, Optional[int]] = Field(alias="cap")

I'm not actually a python dev, and things have changed between versions, but hopefully this information is useful?

@Orhideous
Copy link
Collaborator

Orhideous commented Mar 7, 2024

It's an extremely nice catch, thank you!

Orhideous added a commit that referenced this issue Apr 1, 2024
Orhideous added a commit that referenced this issue Apr 1, 2024
@kiasyn
Copy link
Author

kiasyn commented Apr 1, 2024

Hi, not sure if #293 would fix it as the issue was a null value in capabilities, not the entire capabilities set being null

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 a pull request may close this issue.

2 participants