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

Fix to Fan TURN_ON and TURN_OFF features required for HA 2025.1 (and fix merge issues) #35

Merged
merged 6 commits into from
Jan 6, 2025

Conversation

gdgib
Copy link
Collaborator

@gdgib gdgib commented Jan 6, 2025

No description provided.

elarsson1 and others added 4 commits January 4, 2025 12:43
fix: remove deprecated code
Fix supported Fan features as needed for HA 2025.1. Adds FanEntityFeatures.TURN_ON and FanEntityFeatures.TURN_OFF
# Conflicts:
#	custom_components/vesync/__init__.py
# Conflicts:
#	custom_components/vesync/__init__.py
@gdgib gdgib added the main label Jan 6, 2025
@gdgib gdgib added this to the v1.3.3 milestone Jan 6, 2025
@gdgib gdgib self-assigned this Jan 6, 2025
@gdgib
Copy link
Collaborator Author

gdgib commented Jan 6, 2025

Replaces #33 with all the conflicts resolved

@gdgib gdgib merged commit 6fa4a6a into main Jan 6, 2025
3 checks passed
@gdgib gdgib deleted the elarsson1-fix-fanentityfeatures branch January 6, 2025 23:33
@gdgib gdgib changed the title Fix to Fan TURN_ON and TURN_OFF features required for HA 2025.1 Fix to Fan TURN_ON and TURN_OFF features required for HA 2025.1 (and fix merge issues) Jan 6, 2025
Copy link

@fcastilloec fcastilloec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only fan.py should be modified by this PR


await hass.config_entries.async_forward_entry_setups(
config_entry, list(PLATFORMS.keys())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is undoing the fixes from #32

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite, and I'm definitely not sure I've got the logic right between all the merges, so bear with me for a moment.

If you look at #32, the platforms_list was never populated in the code you were fixing. This fork already had code to populate the platforms_list from PLATFORMS.keys() after filtering through the device_dict. Take a careful read through and let me know if you still think I've got it wrong. I'm going to run some quick tests, and then re-review this.

Oh, and I agree I really should have made a separate PR in a better world.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key is that my fork had platforms_list.append(p) (see https://github.com/haext/custom_vesync/blob/main/custom_components/vesync/__init__.py#L93) already, which solved SOME of the problem you were fixing. I had to deal with the mismatch while resolving merge conflicts, which is how I got a bit turned around and why this change ended up in this PR.

Anyway, I think the logic is correct now. The only difference between my code and what you wrote in that my code won't setup platforms which were excluded from the output of async_process_devices (see https://github.com/haext/custom_vesync/blob/main/custom_components/vesync/common.py#L34), which I think is actually slightly more correct.

As I mentioned I ABSOLUTELY could be wrong about this, so don't feel shy about pointing out anything I missed, or opening a PR that you think is necessary to correct things.

@fcastilloec
Copy link

Seems I was too late, this PR just undid my work. Do you want me to submit a new PR or are you just undoing the last merge and resubmitting this PR?

@gdgib
Copy link
Collaborator Author

gdgib commented Jan 6, 2025

Check the comment I just added. I don't think this actually undoes your work, I think it does the same thing through a slightly different code path. Read carefully, and let me know if you disagree, because if I'm wrong it's the least I can do to fix it myself and not annoy you any more.

@fcastilloec
Copy link

You're right, it's not undoing my code. I was on my phone when I saw it, and didn't check it carefully, I just wanted to type as fast as possible before it got merged (I wasn't fast enough 😄 )

I'm surprised the linter didn't give you an error, because my PR erred at this exact line. Then again, you did update a few of the packages versions, and that might have solved it.
Sorry for the haste!, and thanks for making a new home for this code and maintaining it!

@gdgib
Copy link
Collaborator Author

gdgib commented Jan 7, 2025

I mean chances are we weren't BOTH going to be wrong, and I honestly wasn't sure either. I'm just relieved that I didn't completely screw things up with all the merges and linter updates at the same time. I can't tell you how much I appreciate your keeping an eye on that and warning me you thought something was wrong, on top of your original bug fix. No need to apologize for the haste, it was warranted and appreciated. Thank you so much for all your hard work, and care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants