Add Tuya climate platform#15500
Merged
MartinHjelmare merged 3 commits intohome-assistant:devfrom Jul 17, 2018
Merged
Conversation
2 tasks
Member
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good. A couple of comments.
| modes = self.tuya.operation_list() | ||
| operation_list = [] | ||
| for mode in modes: | ||
| operation_list.append(TUYA_STATE_TO_HA.get(mode)) |
Member
There was a problem hiding this comment.
We should check for None value before appending the value to the operation list.
Member
There was a problem hiding this comment.
Is it expected that the operation list changes during the entity lifetime? Otherwise we could move the creation of the operation list to async_added_to_hass, to not have to do that every state update.
| def set_temperature(self, **kwargs): | ||
| """Set new target temperature.""" | ||
| temperature = kwargs.get(ATTR_TEMPERATURE) | ||
| self.tuya.set_temperature(temperature) |
Member
There was a problem hiding this comment.
Probably guard for None value before setting the temperature. The temperature argument is optional in the service schema for this method.
|
|
||
| async def async_added_to_hass(self): | ||
| """Create operation list when add to hass.""" | ||
| super().async_added_to_hass() |
Member
There was a problem hiding this comment.
This is a coroutine so it needs to be awaited.
michaeldavie
pushed a commit
to michaeldavie/home-assistant
that referenced
this pull request
Jul 31, 2018
* Add Tuya climate platform * fix as review required * fix as review required
Merged
girlpunk
pushed a commit
to girlpunk/home-assistant
that referenced
this pull request
Sep 4, 2018
* Add Tuya climate platform * fix as review required * fix as review required
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Add support for Tuya climate devices. After configuring username and password and country code in Tuya component, home assistant can discover supported devices which related to user's Tuya account and control them through Tuya cloud service.
Now, air conditioner and heater is supported.
Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5806
Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
REQUIREMENTSvariable (example).requirements_all.txtby runningscript/gen_requirements_all.py..coveragerc.If the code does not interact with devices: