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 support for Hisense AEH-W4A1 wifi module (AC remote control) #28641

Merged
merged 63 commits into from Nov 15, 2019

Conversation

@bannhead
Copy link
Contributor

bannhead commented Nov 8, 2019

Description:

This PR add support for various ACs, mainly branded Hisense, that use the AEH-W4A1 module to communicate remotely.
It works in automatic discovery, but it is possible to set static ip addresses in configuration.yaml

Pull request with documentation for home-assistant.io: home-assistant/home-assistant.io#11130

Example entry for configuration.yaml:

hisense_aehw4a1:
  ip_address:
  - 192.168.5.10
  - 192.168.5.20

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.
@homeassistant

This comment has been minimized.

Copy link
Contributor

homeassistant commented Nov 8, 2019

Hi @bannhead,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@project-bot project-bot bot added this to Needs review in Dev Nov 8, 2019
@homeassistant homeassistant added cla-signed and removed cla-needed labels Nov 8, 2019
@bannhead bannhead mentioned this pull request Nov 8, 2019
2 of 2 tasks complete
@bannhead

This comment has been minimized.

Copy link
Contributor Author

bannhead commented Nov 9, 2019

CI errors do not seem related to my PR, what could I do now? If I update dev in my fork and push will it be merged to this PR?
Edit: the answer is yes, I read bottom line!

Dev automation moved this from Needs review to Review in progress Nov 9, 2019
requirements_test.txt Outdated Show resolved Hide resolved
Copy link
Member

MartinHjelmare left a comment

Tests are required for the config flow which needs to be extended with an import step that checks the connection of the ip addresses.

homeassistant/components/hisense_aehw4a1/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/__init__.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/climate.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/climate.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/climate.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/climate.py Outdated Show resolved Hide resolved
homeassistant/components/hisense_aehw4a1/climate.py Outdated Show resolved Hide resolved
bannhead added 18 commits Oct 24, 2019
@bannhead

This comment has been minimized.

Copy link
Contributor Author

bannhead commented Nov 12, 2019

See eg the tests for the hue config flow. Init a user step and an import step and check that all cases are covered.

I need help to make one of the tests work.
I should bypass the IP check function to positively conclude the entity creation procedure

Copy link
Member

MartinHjelmare left a comment

Make sure to patch the device discovery in all the tests. No test should do any real I/O.

tests/components/hisense_aehw4a1/test_init.py Outdated Show resolved Hide resolved
bannhead added 2 commits Nov 12, 2019
Dev automation moved this from Review in progress to Reviewer approved Nov 13, 2019
Copy link
Member

MartinHjelmare left a comment

Great, thanks!

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 13, 2019

Can be merged when build passes.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

MartinHjelmare commented Nov 15, 2019

Should we merge?

@bannhead

This comment has been minimized.

Copy link
Contributor Author

bannhead commented Nov 15, 2019

Using it every day I didn't find any new bugs. The last changes made are minimal and only impact the logic, so I feel comfortable that everything is fine.

@MartinHjelmare MartinHjelmare merged commit d796053 into home-assistant:dev Nov 15, 2019
11 checks passed
11 checks passed
CI Build #20191115.24 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch Coverage not affected.
Details
codecov/project 94.43% (target 90%)
Details
Dev automation moved this from Reviewer approved to Done Nov 15, 2019
pull bot added a commit to KoHcoJlb/home-assistant that referenced this pull request Nov 15, 2019
…e-assistant#28641)

* First commit

* First working release, but there's a lot to do

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* First commit

* First working release, but there's a lot to do

* new file:   requirements_test_all.txt

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* new file:   requirements_test_all.txt

* Fighting with tox

* vs Tox round 2

* Isort and updated requirements_test_all.txt

* Fighting with lint

* Implemented available state

* Changed exception type after Travis-ci pylint fails

* Support entry in configuration.yaml

* Removed commented code

* Switched to async

* Minor changes

* Updated library and fixed pylint errors

* Code optimization

* Implemented static ip addresses in configuration.yaml

* Reverted to existing constant

* Corrected pylint wrong-import-order

* Recovery from nuke event (messing all while rebase)

* Resolved Ci error

* Changes for PR

* Corrected temp scale for frontend

* Added test for config entry from configuration.yaml

* Updated dependency

* Check on manual config

* Imported custom exceptions and modified import config

* Optimized

* Change based on PR revision

* Added logging for failure event on manual config

* Tests added but to be corrected

* Edited tests

* Tests updated to ensure no I/O

* Working on tests

* Cheanges based on revision for PR

* Setting librey exception as direct side_effect in test

* Final changes for PR

* Redundand on command solved

* Improved AC logic
@bannhead bannhead deleted the bannhead:Hisense-AEH-W4A1 branch Nov 15, 2019
KJonline added a commit to KJonline/home-assistant that referenced this pull request Nov 16, 2019
* dev: (200 commits)
  Truncate sensor state values (home-assistant#28788)
  Fix broken postnl sensor (home-assistant#28794)
  Move imports in braviatv component (home-assistant#27855)
  Add ombi password authentication option (home-assistant#28742)
  Lint exclusions (home-assistant#28655)
  Upgrade pylint, tweak config (home-assistant#28798)
  Bump pyHik library to 0.2.5 for id, tamper fixes (home-assistant#28807)
  Upgrade sqlalchemy to 1.3.11 (home-assistant#28721)
  Fix Repetier integration entity indexing (home-assistant#28766)
  Updated frontend to 20191115.0 (home-assistant#28797)
  [ci skip] Translation update
  Add support for Hisense AEH-W4A1 wifi module (AC remote control) (home-assistant#28641)
  Fix changing venstar operation_mode (home-assistant#28754)
  Fix Swisscom empty response received (home-assistant#28782)
  Fix HomematicIP Cloud Alarm Control Panel support for basic mode (home-assistant#28778)
  Change keys for Samsung TV next and prev track command (home-assistant#28213)
  Change unique id for SAJ sensor based on device SN (home-assistant#28663)
  bump home mitemp_bt to 0.0.3. It has an important bugfix for reading … (home-assistant#28765)
  Convert Tesla to Async (home-assistant#28748)
  Bump pytest to 5.2.3 (home-assistant#28785)
  ...

# Conflicts:
#	homeassistant/generated/config_flows.py
#	script/gen_requirements_all.py
thomasgermain added a commit to thomasgermain/home-assistant that referenced this pull request Nov 16, 2019
…e-assistant#28641)

* First commit

* First working release, but there's a lot to do

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* First commit

* First working release, but there's a lot to do

* new file:   requirements_test_all.txt

* Added support for preset_modes

* Refined logic

* Added translations for config_flow

* Updated translations

* modified:   homeassistant/components/hisense_aehw4a1/climate.py

* modified:   climate.py

* Updated library to latest version

* Small changes

* Null states when AC off

* Minor fixes

* Latest updates for TOX

* new file:   requirements_test_all.txt

* Fighting with tox

* vs Tox round 2

* Isort and updated requirements_test_all.txt

* Fighting with lint

* Implemented available state

* Changed exception type after Travis-ci pylint fails

* Support entry in configuration.yaml

* Removed commented code

* Switched to async

* Minor changes

* Updated library and fixed pylint errors

* Code optimization

* Implemented static ip addresses in configuration.yaml

* Reverted to existing constant

* Corrected pylint wrong-import-order

* Recovery from nuke event (messing all while rebase)

* Resolved Ci error

* Changes for PR

* Corrected temp scale for frontend

* Added test for config entry from configuration.yaml

* Updated dependency

* Check on manual config

* Imported custom exceptions and modified import config

* Optimized

* Change based on PR revision

* Added logging for failure event on manual config

* Tests added but to be corrected

* Edited tests

* Tests updated to ensure no I/O

* Working on tests

* Cheanges based on revision for PR

* Setting librey exception as direct side_effect in test

* Final changes for PR

* Redundand on command solved

* Improved AC logic
@lock lock bot locked and limited conversation to collaborators Nov 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
3 participants
You can’t perform that action at this time.