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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuya correct scaling #69348

Merged
merged 1 commit into from Apr 26, 2022
Merged

Tuya correct scaling #69348

merged 1 commit into from Apr 26, 2022

Conversation

starkillerOG
Copy link
Contributor

@starkillerOG starkillerOG commented Apr 5, 2022

Breaking change

Proposed change

Correct Tuya scaling according to the current Tuya documentation: https://developer.tuya.com/en/docs/iot/datatypedescription?id=K9i5ql2jo7j1k#title-1-Example

afbeelding

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

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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

Hey there @tuya, @zlinoliver, @METISU, @frenck, mind taking a look at this pull request as it has been labeled with an integration (tuya) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

The linked documentation still contains conflicting values. We should not change a thing until everything is crystal clear.

@starkillerOG
Copy link
Contributor Author

@frenck did you hear back from the Tuya engineers?
Schould I contact Tuya again and ask them to look at the documentation again and resolve all the conflicts in the documentation and make it consistent?

@starkillerOG
Copy link
Contributor Author

@frenck I also noticed that this PR was merged: #66715
Which adds this code:

if self._current_temperature.scale == 0 and self._current_temperature.step != 1:
# The current temperature can have a scale of 0 or 1 and is used for
# rounding, Home Assistant doesn't need to round but we will always
# need to divide the value by 10^1 in case of 0 as scale.
# https://developer.tuya.com/en/docs/iot/shift-temperature-scale-follow-the-setting-of-app-account-center?id=Ka9qo7so58efq#title-7-Round%20values
temperature = temperature / 10

That seems like very sketchy fix related to this same scaling documentation.

@frenck
Copy link
Member

frenck commented Apr 7, 2022

yes its part of the same docs horror :D

@starkillerOG
Copy link
Contributor Author

I just got a new response from a Tuya engineer (see screenshot):
afbeelding

This again confirms that the step value schould not be included in the calculation.

@frenck I think this is a very clear answer.

@frenck
Copy link
Member

frenck commented Apr 7, 2022

Sure they also responded differently depending on the engineer handling the issue. The fact remains, the documentation still is contradicting and conflicting, has been adjusted multiple times.

@starkillerOG
Copy link
Contributor Author

starkillerOG commented Apr 7, 2022

@frenck alright, I get your point and have observed the same.
How do you propuse we solve this then?
Do you want to have confirmation from some department head of the API?

Edit: I just want to find a path to solving this and be helpfull, not trying to rush or force anything.

Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Alright, let's revert this and fix it as it should be according to many resources.

It is known to break some thermostats (like Moes).
We should look into quirk handling.

@frenck frenck merged commit d418df5 into home-assistant:dev Apr 26, 2022
@Santanachia
Copy link

It is known to break some thermostats (like Moes).

if I have two integrations added, can I have some devices added in one and some in the other on the same account? Then we could add a checkbox "use step" to the main integration settings and have some devices with it on and some with it off.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants