-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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 humidifier entity for Vesync devices #134333
Conversation
Hey there @markperdue, @webdjoe, @TheGardenMonkey, @cdnninja, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
b5084be
to
8604ee8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on us shifting to checking the class used by the library vs keeping a full list of models? It seems a key pain point is sometimes the underlying library supports a variant and we miss adding it.
I was hoping for two approaches. 1. When can just validate the value exists use that. 2. If needing to know for sure if it's a type like fan or humidifier check the class.
I think you are suggesting checking device.type against VeSyncHumid200S or VeSyncSuperior6000S or VeSyncHumid1000S in I do see there is this humidifier VeSyncSuperior6000S which does not derive from |
Something along those lines yes. Also for other purposes. I am finding a key challenge with the way it is written today is it depends on the vesync library stating something is a "fan" or "switch" when a platform of switch in HA doesn't align, switch can be used for many things, including screens, power, modes etc. So the platforms themselves need an easy way to check support. I think the binary sensor code does that for most values reasonable well, just need a way to check methods in addition. For fan and humidifier I feel like a method like you mentioned above makes sense. Check if it is one of the classes. That way variants are covered without us mapping everything. If interested could you join the HA discord so we can message on this? Love the work you are doing! Ps I have a refactored draft of switch ready as well. I am waiting for items to be merged though since lots outstanding on that front. |
I have adjusted the |
3b0ace5
to
adca316
Compare
I agree with #134166 (review) joostlek comment that we should move our platform checks within the platform. It would greatly simplify some of the code. Thinking as we add new platforms we should do that. As well do you see any value in the discovery call back? I don't think it will be used, just seems to complicate things? |
The discovery service would only be used if one add/removes devices to the account. It feels more intuitive to "Reload" the integration which should update the devices or would that not remove the older entities? Maybe that is still okay, one can remove them manually. |
Correct but with the coordinator change we only call updates to the devices so we will never see a new device? |
Yes and I think that is okay. Maybe that is why all integrations have the reload option. I have not seen or used an integration which queries for device update but my integration usage is limited. |
Some do, I agree reload makes more sense here. |
@home-assistant add-label new-feature |
Quick note in another PR they wanted to keep the callbacks and potentially add a scheduled device list update. So for this we should keep it in. Eventually we can add a PR to check for devices from time to time. I am thinking this can be re-based and go for review? I don't think it actually depends on the binary_sensor beyond potential test conflicts which could be quickly updated once binary is merged? |
I also wonder if switch changes should be removed from this to make it easier to get across the finish line. Then we can add those features after #134409 gets merged. |
That is a good idea. I will keep humidifier simple for now and then add sensor/switches later. |
adca316
to
db8cfe0
Compare
This is ready for review but there is this check "Has at least one of the required labels (breaking-change, bugfix, code-quality, dependency, deprecation, new-feature, new-integration)" which is failing and I am not sure what I need to do to address that. The documentation PR only mentions 2 humidifiers. I can only verify the functionality on the model I have. @joostlek Would you be able to review this too? |
@home-assistant add-label new-feature |
c130e59
to
8a157ed
Compare
277acee
to
8967f55
Compare
Resolved conflicts |
Thank you for your work guys! I can't wait to use it for my installation |
Amazing work! This one has been an ask for many years from the community so very excited it is done! |
Proposed change
This request introduces humidifier entities (and related sensors) for Vesync devices.
This is not a complete representation of the humidifier. The humidifier exposes some binary states and allows number mist level to be set. The former is being introduced in #134221 and I will introduce the latter in another PR.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: