Closed mcolyer closed 1 month ago
Thanks for giving this a try - glad it works!
My goal is indeed to have this available in home assistant.
I have to upload get the package on pypi first though.
Then I was wondering if there was an ANOVA integration that I could add device support for before starting a separate integration.
I see you started setting one up, happy to contribute to it!
FYI I pushed this package to PyPI (woo, my first release!).
Nice! I'm still working on getting the tests setup to run correctly in that repo you found. Not too familiar with home assistant so happy to accept any PRs on it.
@mcolyer I was worried that all integration templates and examples out there would require considerable effort to be updated and put into a working state. I tried getting started with https://github.com/mcolyer/hacs-anova-nano - but I'm unsure how. If I just naively run the tests with pytest
I get a pytest_socket.SocketBlockedError: A test tried to use socket.socket
error on all tests. Are you seeing the same thing?
If I just naively run the tests with
pytest
I get apytest_socket.SocketBlockedError: A test tried to use socket.socket
error on all tests. Are you seeing the same thing?
I might not have pushed the latest up to my repo but it should be there now. If you run:
python3 -m pip install --requirement requirements_test.txt
scripts/test
does it work? All of my tests pass locally, so if it doesn't we're just missing some of the setup.
Also the part I got stuck on is that apparently, HomeAssisstant has its own Bleak client and so we need to hook into that for both getting data and discovery:
https://developers.home-assistant.io/docs/core/bluetooth/api/
I started trying to integrate into but didn't get very far - I've put up a draft PR with where I left it in case it's useful - https://github.com/mcolyer/hacs-anova-nano/pull/1.
My problem might be that I'm currently on Windows.
As for the hass bluetooth integration - I'll have to read into the docs, codebase and examples a lot to see how things should tie together. Thanks for the link! Might have to make some adjustments to make this library compatible but at least it's also based on bleak.
However I want to get the tests passing on my end first.
Edit: Got my development issues "sorted" by running it all on linux on a rpi.
Created https://github.com/mcolyer/hacs-anova-nano/pull/2 but I'm unable to get it to work. Thinking that ActiveBluetoothDataUpdateCoordinator is probably not the correct base class for how we interact with the Nano device but I find it difficult to understand hass' API. There's not that examples out there and I don't see what I'm missing.
It might be worth mentioning this to the ESPHome folks. They already have a BLE climate object, but don't have Nano support. Could be a good collab. https://esphome.io/components/climate/anova.html
For esphome the code would likely have to be translated to C++ which is sadly outside my current abilities.
Closing this. The integration is a WIP here: https://github.com/mcolyer/hacs-anova-nano/pull/2
First off, this is amazing - I downloaded your library and it worked the first try without any changes on my end!
I'm most interested in hooking this up to home assistant and was wondering if you had any plans to do so before starting.