Skip to content

Fix fan not checking supported_features#35248

Merged
MartinHjelmare merged 6 commits intohome-assistant:devfrom
shenxn:fan-fix
May 6, 2020
Merged

Fix fan not checking supported_features#35248
MartinHjelmare merged 6 commits intohome-assistant:devfrom
shenxn:fan-fix

Conversation

@shenxn
Copy link
Copy Markdown
Contributor

@shenxn shenxn commented May 5, 2020

Proposed change

Fix the problem that FanEntity.capability_attributes and FanEntity.state_attributes do not check supported_features.

Docs update:

home-assistant/developers.home-assistant#496

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Thanks! A small change needed below.

Also, have we checked that no other platforms need updating than the demo platform?

Please also update our developer docs and include oscillating, in the properties:
https://developers.home-assistant.io/docs/entity_fan#properties

Comment thread tests/components/fan/test_init.py Outdated
@shenxn
Copy link
Copy Markdown
Contributor Author

shenxn commented May 6, 2020

@MartinHjelmare I don't have any other fan devices to check. But the tests all passed and I checked all integrations that supports fan. Only dyson, homekit_controller, mqtt, template, and tuya support oscillating and all of them seem to implemented using property which should not need to be fixed. The tuya integration now has unnecessary check but it will not break anything so maybe it can be fixed in another PR.

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Good!

@MartinHjelmare MartinHjelmare merged commit 2581b03 into home-assistant:dev May 6, 2020
@Jc2k
Copy link
Copy Markdown
Member

Jc2k commented May 6, 2020

Nice! Thanks for this @shenxn

@shenxn shenxn deleted the fan-fix branch May 6, 2020 08:01
@lock lock Bot locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HomeKit Controller does not check supported features when update state

4 participants