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

Fix Tuya data type information in climate #62994

Merged
merged 1 commit into from
Dec 29, 2021
Merged

Fix Tuya data type information in climate #62994

merged 1 commit into from
Dec 29, 2021

Conversation

frenck
Copy link
Member

@frenck frenck commented Dec 29, 2021

Proposed change

Similar to #62993, but for climate

The Tuya API provides functions definitions and status_ranges; These are a bit of the same and most often mixed up (which origins are already in the original Tuya V2 custom integration).

Looking at the specs, the issues reported and the upstream client code, we should use the type description from the function instead of the status range when we are using an exposed/changeable functionality.

This PR adjusts it for the climate entities.

Tested against two heaters I have locally, to verify those still work as expected.

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, 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)

@frenck frenck added this to the 2021.12.7 milestone Dec 29, 2021
@frenck frenck merged commit 17536df into dev Dec 29, 2021
@frenck frenck deleted the frenck-2021-3386 branch December 29, 2021 14:34
@frenck frenck mentioned this pull request Dec 29, 2021
@ahuntjens
Copy link

This did not resolve the climate issue for the eurom heater issues merged. :-(.
Did a reinstall if the integration but no difference after 2021.07 update.

Logger: homeassistant.components.climate
Source: components/tuya/base.py:48
Integration: Klimaat (documentation, issues)
First occurred: 00:07:49 (3 occurrences)
Last logged: 00:19:14

Error while setting up tuya platform for climate
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform
await asyncio.shield(task)
File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 107, in async_setup_entry
async_discover_device([*hass_data.device_manager.device_map])
File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 99, in async_discover_device
TuyaClimateEntity(
File "/usr/src/homeassistant/homeassistant/components/tuya/climate.py", line 192, in init
self._attr_max_temp = type_data.max_scaled
File "/usr/src/homeassistant/homeassistant/components/tuya/base.py", line 34, in max_scaled
return self.scale_value(self.max)
File "/usr/src/homeassistant/homeassistant/components/tuya/base.py", line 48, in scale_value
return value * 1.0 / (10 ** self.scale)
TypeError: can't multiply sequence by non-int of type 'float'

@frenck
Copy link
Member Author

frenck commented Dec 29, 2021

This is a PR, which is closed and handled. If you experience an issue, please create an issue report.

@ahuntjens
Copy link

ahuntjens commented Dec 29, 2021

thanks for the response, im not sure how. anyways the problem isnt solved for the eurom heaters( tuya api) so I would think the issues that are closed can be re opened?

@frenck
Copy link
Member Author

frenck commented Dec 30, 2021

No, please create a new issue in the issue tracker an provide as much information as possible about the issue you are experiencing. Thanks 👍

@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.