-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add fbx autodetection #22
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice, thanks! I have a small nitpick regarding the version parsing, but apart from that the PR is great, very useful!
@SNoof85 Any opinion on this change? If I remember correctly, the API version is fixed in Home Assistant to v4, so the change should not require any changes. It could probably be used to simplify the hass configuration. |
For sure in home assistant the api version is fixed in the Freebox integration : https://github.com/home-assistant/home-assistant/blob/71f73af535f68f8df8b4f9e229942942c67a46d3/homeassistant/components/freebox/__init__.py#L63 So in my opinion it won't break anything and i like this feature. Problem is still lack of documentation and i need to test with latest API what we have already in home assistant before using this. (if i see any use case...). Looks good to me for merging ! 🚀 |
Since the latest release (4.1) the API version is now 7. |
This release has not hit my Freebox révolution right now I can't do any testing. We must keep an option to make the calls with a specific API version. Autodetect can be good to have but it should be possible to override. |
Hey @foreign-sub! Thanks a lot for all the work you put in this library, really, but honestly I don't know how I am supposed to review your PRs: every time I come back on a PR the entire code has changed since the last time I reviewed, so I need to review everything from scratch. I'm not that attached to this library, so I'm not sure I want to spend dozens of evening reviewing code for it (I have a family, and I already do code reviews all day long at work 😄). Moreover, you seem to have more information than me about the Freebox API, the only thing I have is the doc of API v4 here, and I only have a Freebox mini 4K. What would you think of continuing development on your own fork? I would transfer ownership of the pypi package to you (and @SNoof85 if he wants to?) so that you can publish new packages. What do you say? |
Hi, @stilllman, sorry about that, it was totally unforeseen. |
I think we can let some time to @foreign-sub to polish and then make a final review, publish a package. |
…lues, extra polish
Sorry for the long silence, I'll try to finalize the reviews during the christmas holidays |
Oh! @SNoof85 @foreign-sub I just found by accident that the up-to-date API documentation is available in the Freebox help menu, on http://mafreebox.freebox.fr ! |
No way ! How could we missed that for ages ! Mine says current API is v5... seems outdated again. Not so much than in the official website. Edit2 : but everything else is correct ! Looks like we have a reliable source ! |
Hey @stilllman , @SNoof85 , Sorry it took so long, typing was ..., but it's done. I've merged everything in the following branch if you wanna give it a try: |
@stilllman for me it's OK to get the ownership 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not finished review
@@ -103,3 +103,6 @@ venv.bak/ | |||
|
|||
# mypy | |||
.mypy_cache/ | |||
|
|||
#vscode | |||
.vscode/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a EOF
return self._get_db_base_url(self._fbx_uid) | ||
|
||
@property | ||
def fbx_api_mods(self) -> Optional[list]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def fbx_api_mods(self) -> Optional[list]: | |
def fbx_api_modules(self) -> Optional[list]: |
Detect freebox host, port and api_version
cleanup, format, refactor
Support any number of freeboxes
Open by uid
breaking change : token file has been removed, each freebox now has it's own token file indexed by uid
api modules instances are now created only when they're called.
settings can be stored anywhere using the data_dir option.