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

Split cover.py #490

Merged
merged 11 commits into from
Jul 26, 2021
Merged

Split cover.py #490

merged 11 commits into from
Jul 26, 2021

Conversation

tetienne
Copy link
Collaborator

In order to ease maintenance and reduce complexity, as we did for the climate platform, I think we should split the cover module.

Next candidate will be the DiscreteGateWithPedestrianPosition

@iMicknl
Copy link
Owner

iMicknl commented Jul 21, 2021

Good proposal!

@tetienne tetienne marked this pull request as ready for review July 25, 2021 20:35
@iMicknl
Copy link
Owner

iMicknl commented Jul 25, 2021

I will have a good look tomorrow. Should we keep it the same as climate device? Thus naming the class Awning instead of TahomaAwning`? (Or maybe rename all the climate devices eventually).

I would love to see our base cover most of the cases, where we have specific classes for groups of devices. (like Awning). Eventually I will have a look if I can implement the rts:VenetianBlindRTSComponent :-).

jcallaghan/home-assistant-config#277 (comment)

@tetienne
Copy link
Collaborator Author

I will have a good look tomorrow. Should we keep it the same as climate device? Thus naming the class Awning instead of TahomaAwning`? (Or maybe rename all the climate devices eventually).

I’ve renamed my class to Awning. It’s indeed more homogeneous with what you did for the climate.

I would love to see our base cover most of the cases, where we have specific classes for groups of devices. (like Awning). Eventually I will have a look if I can implement the rts:VenetianBlindRTSComponent :-).
It will indeed reduce the complexity of our main cover class. It probably ease the code review for the Core repo...

@tetienne
Copy link
Collaborator Author

Ready to be merged.

@tetienne tetienne added the enhancement New feature or request label Jul 26, 2021
vlebourl
vlebourl previously approved these changes Jul 26, 2021
Copy link
Collaborator

@vlebourl vlebourl left a comment

Choose a reason for hiding this comment

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

Fine by me. Suggestions are cosmetic. I'd prefer we have either Awning and VerticalCover, or TahomaAwning and TahomaVerticalCover. I's also prefer to keep the TahomaGenericCover code in cover.py as the base code for all other implementations. But I won't fight for it too much.

custom_components/tahoma/cover.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/awning.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/tahoma_cover.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/awning.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/awning.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/awning.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/vertical_cover.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/vertical_cover.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/vertical_cover.py Outdated Show resolved Hide resolved
custom_components/tahoma/cover_devices/vertical_cover.py Outdated Show resolved Hide resolved
@tetienne tetienne merged commit e58a1e5 into master Jul 26, 2021
@tetienne tetienne deleted the refactor/split-cover branch July 26, 2021 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants