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

add "lumi.acpartner.v3" since it also works with this code #769

Merged
merged 2 commits into from
Jul 21, 2020

Conversation

starkillerOG
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Jul 19, 2020

Coverage Status

Coverage increased (+0.01%) to 73.842% when pulling fe0a8f1 on starkillerOG:patch-15 into 0ca105d on rytilahti:master.

Copy link
Owner

@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

So, I'm not sure how this should be properly handled. There is miio/airconditioningcompanion.py which has this mode, so if both of these would be added to homeassistant it would double the number of requests, no?

Maybe the common functionality needs to be refactored out, assuming the API is really the same for both..

@starkillerOG
Copy link
Contributor Author

@rytilahti I was also supprised that the AC partner supported the same API.
But according to @shenxn it supports both the alarm feature and connected zigbee subdevices (see discussion here: home-assistant/core#37959)

@starkillerOG
Copy link
Contributor Author

@rytilahti not sure what the best way is for the AC partner......
Maybe that needs to be done after a refactor of the gateway.py file in which we split out that file as discussed earlier into a seperate folder with seperate files for each subdevice.....
Maybe all of the code of miio/airconditioningcompanion.py could then be placed as a part of the gateway just like the alarm, light etc.

@shenxn
Copy link

shenxn commented Jul 20, 2020

Since the AirConditioningCompanion and Gateway are reading different properties, keep them in different classes should only double the handshake (discovery), which should only happen once. So I think it is acceptable for now. It is better to do some refactor, though. But I haven't came up with a good way to do this.

@rytilahti
Copy link
Owner

Okay, fine by me. Maybe due time the specific gateway features are contained inside their own implementation files (e.g., alarm, light) that can be re-used on other gateways. I remember reading long time ago from somewhere that the gateways and ac partners share quite a bit of implementation which may not be that surprising as they are both developed by "lumi".

@rytilahti rytilahti merged commit 79e61fb into rytilahti:master Jul 21, 2020
xvlady pushed a commit to xvlady/python-miio that referenced this pull request May 9, 2021
…#769)

* add "lumi.acpartner.v3" since it also works with this code

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

Successfully merging this pull request may close these issues.

4 participants