Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add support for Dyson Hot+Cool Fan as a climate device #14598
This PR added support for Dyson pure hot+cool fan as a climate device. In additional of the fan functionality, this component will expose the hot+cool fan as a climate device to control temperature, fan mode, etc.
referenced this pull request
May 23, 2018
Don't change the access mode (644 -> 755) of the dyson component module.
Is it enough to only use Celsius when home assistant is interfacing with the device or do we need to use both Celsius and Fahrenheit to not confuse the user when the user is interfacing with the device outside of home assistant?
See further comments below and the unresolved comments above.
A note on the reason behind all the fuss of
Therefore, when I wrote the component the
Apology for the access mode, probably happens when I switched the working environment to windows at some point.
Also minor changes to all the enum instances. I shouldn't compare the state values (which are string instances because that's what dyson device reports via mqtt) to enum objects. Not sure why it works before (probably due to different python version? The equality now return false when comparing string to enum with the same value). But I should compare them with the enum's value instead.
Thanks for the clarification. It makes more sense now. Good renaming and refactoring too.
I just looked at the coverage report, and the coverage is too low for the new module.
Please either add tests to reach 95% or exclude the module from coverage calculation in
Now we never test setting up the whole component and this platform. We just test calling
In general we try to write tests a bit more like integration tests, by using the home assistant core to set up the tests and also fetch state and assert state. Doing this usually simplifies testing, ie fewer tests will cover more code, and makes the tests more robust.
Coroutines can be tested by standalone pytest test functions that are defined as coroutines. Though
I am confusing about self._pending_target_temp, seems unnecessary,