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 new modes in Tuya Climate #5159

Merged
merged 17 commits into from Mar 21, 2024

Conversation

moriahmorgan
Copy link
Contributor

@moriahmorgan moriahmorgan commented Jul 27, 2023

What does this implement/fix?

Added support for Fan Only Mode, Dry Mode, Swing Mode and Fan Speed Control.

Also added/fixed support for entity states syncing with current operation mode.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other

Related issue or feature (if applicable): fixes
esphome/feature-requests#2329
Pull request in esphome-docs with documentation (if applicable): esphome/esphome-docs#3096

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040

Example entry for config.yaml:

climate:
  - platform: tuya
    id: "tuya_climate"
    name: None
    switch_datapoint: 1
    target_temperature_datapoint: 2
    current_temperature_datapoint: 3
    supports_heat: True
    supports_cool: True
    active_state:
      datapoint: 4
      cooling_value: 0
      heating_value: 1
      drying_value: 2
      fanonly_value: 3
    preset:
      eco:
        datapoint: 8
        temperature: 28
      sleep:
        datapoint: 101
    swing_mode:
      vertical_datapoint: 106
      horizontal_datapoint: 107
    fan_mode:
      datapoint: 5
      auto_value: 0
      low_value: 2
      medium_value: 3
      middle_value: 4
      high_value: 1

Checklist:

  • The code change is tested and works locally.
  • [?] Tests have been added to verify that the new code works (under tests/ folder).

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

Added support for Fan Only Mode, Dry Mode, Swing Mode and Fan Speed Control.

Also added/fixed support for entity states syncing with current operation mode.
Added support for Fan Only Mode, Dry Mode, Swing Mode and Fan Speed Control.

Also added/fixed support for entity states syncing with current operation mode.

This commit fixes the namespace, because I uploaded the test files to start with.
Add grouping to Preset, Swing Mode, Fan Speed and Active State. This is a breaking change.
@moriahmorgan
Copy link
Contributor Author

This is now a breaking change. Added grouping to Preset, Swing Mode, Fan Speed and Active State.

Formatting changes to be compliant with black and flake8. Also changed constants to match expected format.
esphome/components/tuya/climate/__init__.py Outdated Show resolved Hide resolved
esphome/components/tuya/climate/__init__.py Show resolved Hide resolved
esphome/components/tuya/climate/__init__.py Outdated Show resolved Hide resolved
esphome/components/tuya/climate/__init__.py Outdated Show resolved Hide resolved
moriahmorgan added a commit to moriahmorgan/esphome-docs that referenced this pull request Jul 31, 2023
Update Tuya climate documentation to align with esphome/esphome#5159
moriahmorgan added a commit to moriahmorgan/esphome-docs that referenced this pull request Jul 31, 2023
Update Tuya Climate to document related to esphome/esphome#5159
@moriahmorgan
Copy link
Contributor Author

Requested changes reviewed and changes applied in single commit so that I could validate testing. Also put Sleep preset in its own config block to be consistent with other presets and fix logic for validate_cooling_values function to better align with existing documentation.

moriahmorgan and others added 2 commits July 31, 2023 17:19
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
adding "this->" to some member variables in the swing_mode function.
Adding Walrus Operator in the to_code function for _init_.py similar to esphome#5181
@moriahmorgan
Copy link
Contributor Author

moriahmorgan commented Aug 3, 2023

Not sure what's causing CI / Run YAML test 4 (pull_request) to fail...

catlee added a commit to catlee/esphome that referenced this pull request Dec 7, 2023
Copy link
Contributor

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 12, 2023
@jesserockz jesserockz added not-stale Won't go stale and removed stale labels Dec 12, 2023
catlee added a commit to catlee/esphome that referenced this pull request Dec 20, 2023
@PsychoRS

This comment was marked as off-topic.

@shakin89
Copy link

Is there any chance to have this pr merged?
I successfully flashed 5 devices, Beca BAC-002 CB3S based, and cannot set correctly fan speed during heating/cooling nor set fan_only mode.
I would be sad to come back to the original firmware.

@moriahmorgan
Copy link
Contributor Author

Is there any chance to have this pr merged? I successfully flashed 5 devices, Beca BAC-002 CB3S based, and cannot set correctly fan speed during heating/cooling nor set fan_only mode. I would be sad to come back to the original firmware.

I think it's just waiting on me to finish documentation. I have had a bit of a busy last few months health related and it keeps getting put on the back burner. I will attempt to finish this weekend, since @jesserockz is currently out for the rest of the week.

@shakin89
Copy link

I think it's just waiting on me to finish documentation. I have had a bit of a busy last few months health related and it keeps getting put on the back burner. I will attempt to finish this weekend, since @jesserockz is currently out for the rest of the week.

I'm sorry, hope you are well now. Let me know if i can help writing the docs in some way.
Thanks both for the great work done till now.

@moriahmorgan
Copy link
Contributor Author

@shakin89 Docs updated, just waiting for review, approval, then merge by @jesserockz when he has time, unless there are other issues to resolve. It has been some months since I looked at the code and I don't know if there's any issues right now with merging this.

@codecov-commenter
Copy link

codecov-commenter commented Mar 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.49%. Comparing base (4d8b5ed) to head (f851a6e).
Report is 243 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #5159      +/-   ##
==========================================
- Coverage   53.70%   53.49%   -0.22%     
==========================================
  Files          50       50              
  Lines        9408     9520     +112     
  Branches     1654     1684      +30     
==========================================
+ Hits         5053     5093      +40     
- Misses       4056     4119      +63     
- Partials      299      308       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kbx81 kbx81 merged commit 1305980 into esphome:dev Mar 21, 2024
55 checks passed
kbx81 added a commit to esphome/esphome-docs that referenced this pull request Mar 21, 2024
* Update Tuya Climate for new esphome PR

Update Tuya Climate to document related to esphome/esphome#5159

* Remove Deprecated Config Block

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Update tuya.rst

* Restore basic device configuration sample block, will use more specific examples in the device repo

* Apply suggestions from code review

Copy fixes

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: H. Árkosi Róbert <robreg@zsurob.hu>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
@github-actions github-actions bot locked and limited conversation to collaborators Mar 22, 2024
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.

None yet

6 participants