shenxn / ha-dyson-cloud

Cloud integration for ha-dyson (https://github.com/shenxn/ha-dyson/)
MIT License
33 stars 20 forks source link

New actively maintained integration! Collaborators welcome! Details inside. #20

Open dotvezz opened 1 year ago

dotvezz commented 1 year ago

What Happened?

I've created a new Github organization, The libdyson Working Group and published updated versions of libdyson, ha-dyson, and ha-dyson-cloud. The new forks are actively maintained, and I would be excited to talk with any contributors about joining the organization.

I'm currently working on merging all the commits from Pull Requests, then I'll address all the Issues. There are a few conflicts in the Pull Requests regarding newer devices (Formaldehyde fans/heaters, Humidifiers, and refreshes like the HP07 refresh of the HP04). For the time being, Formaldehyde models are the next on my list of things to tackle.

How can I help?

Anyone interested in helping, even if it's just reviewing and merging Pull Requests, please let me know here in this thread, or via email (ben+libdyson@vez.email)!

Why Fork?

I'm really grateful to @shenxn for their dedication to the project over the years. Sadly, they've been pretty quiet for the past 4~5 months and the integration has started breaking for some people, especially people using new unsupported devices. Eventually, it seemed appropriate to talk about making a community fork to keep things moving.

I especially want to make sure there's at least two people who can merge Pull Requests. This isn't the biggest repo in the world, but it is used by people and gives us some really nice features that are otherwise impossible to access. So I want to make sure all of us continue to have that.

What are the goals?

Primarily, just to keep this working and maintained. I'd personally like to make the integrations and library easier to use, and I'm open to any kind of improvements that the community might have - PR's welcome! Other than that, my short term goals over the next few days are:

  1. Finish merging all the PR's from the past few months to add support for new devices, features for vacuums. This is partially complete right now.
  2. Get Formaldehyde, Humidifier, and other new models working and reporting the correct information.
    • There are some PRs, but Dyson is being weird and giving different models the same Device ID's which confuses the logic of libdyson right now.
  3. Done: Work with Github support to remove the Fork status so that the new repos can have their own dedicated Issues tracker.
  4. Get some more members on the working group to ensure PRs get merged quickly and updates happen.
  5. Try my best to help people get migrated if they need to.

How do I switch from @shenxn's repos to the new repos?

Experimental no-reconfiguration swap

I haven't tested this method very much, but in my experiments it seems possible to switch over with zero impact to your current integration configuration, entities/devices, or dashboards. I don't know what side-effects it may have though (leftover old config data might start causing issues or something - no guarantees).

  1. Remove the ha-dyson and ha-dyson-cloud custom repositories from HACS
    • Without removing the integrations themselves.
  2. Add the new ha-dyson and ha-dyson-cloud custom repositories
    • The ha-dyson-cloud repository is only necessary if you already use it, or are intending to use its features. It is not required, but currently, it makes setting up new devices like HP07 (527K) much simpler.
  3. Update the ha-dyson and ha-dyson-cloud repositories using the HACS updater

Proven some-reconfiguration swap

This is proven to work without any side effects. If you used the default IDs for the entities and devices, then you'll just need to re-configure the devices but your dashboards will not need updating.

  1. Remove the Dyson Local and Dyson Cloud integrations from your /config/integrations page.
  2. Remove the Dyson Local and Dyson Cloud integrations from your /hacs/integrations page.
  3. Remove the dyson-ha and dyson-ha-cloud custom repositories from HACS
  4. Add the new dyson-ha and dyson-ha-cloud custom repositories
    • The libdyson-ha-cloud repository is only necessary if you already use it, or are intending to use its features. It is not required, but currently, it makes setting up new devices like HP07 (527K) much simpler.
  5. Update the dyson-ha and dyson-ha-cloud repositories

That should be it! But if you have any issues doing this, please share: https://github.com/libdyson-wg/ha-dyson-cloud/issues

itnassol commented 1 year ago

Hi, I have downloaded the new repositories, installed both and re-booted after each install, I start the cloud integration, it asks for my country I say UK, the on entering my email address I get this?

Settings_–_Home_Assistant_-_2023-03-19_10 13 24

Any clue? Thanks.

Oh and here is what is in the log..

This error originated from a custom integration.

Logger: aiohttp.server Source: custom_components/dyson_cloud/config_flow.py:71 Integration: Dyson Cloud (documentation, issues) First occurred: 10:10:42 (5 occurrences) Last logged: 10:13:03

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle resp = await handler(request) File "/usr/local/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 67, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 235, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 146, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 180, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper result = await method(view, request, data, *args, *kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 271, in async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/config/custom_components/dyson_cloud/config_flow.py", line 71, in async_step_email self._verify = await self.hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/libdyson/cloud/account.py", line 122, in login_email_otp response = self.request( File "/usr/local/lib/python3.10/site-packages/libdyson/cloud/account.py", line 114, in request raise DysonInvalidAuth libdyson.exceptions.DysonInvalidAuth

dotvezz commented 1 year ago

Hi @itnassol! That's actually a known issue on the old repo as well. There's a note on the Readme and also some more details on the new repo with a workaround for you.

itnassol commented 1 year ago

Brilliant thank you, all showing up, if you need me to try anything here, just shout as I have 3 different models and another 3 coming online this year, this is all part of a big project so just shout of you want me to test anything. Thanks again.

dotvezz commented 1 year ago

Ooops, I meant to keep this open for visibility. Reopening.