Add MQTT climate setting for current humidity#84592
Conversation
|
Hi Stonos 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! |
|
Hey there @emontnemery, @jbouwh, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
jbouwh
left a comment
There was a problem hiding this comment.
Nice idea to add this missing functionality to MQTT climate. It only misses support to be able to set a humidity yet.
|
Let me know if you can follow up on the request to do some changes. I think the start is okay. If you like , I could help getting some progress to this Idea. Let me know, what you if you would like that. |
|
Sorry, I didn't have much time to work on it in the past few days. I'll try to make the requested changes either today or tomorrow. Thanks, I'll let you know if I have any questions/need help! |
2f90657 to
38f7bd4
Compare
jbouwh
left a comment
There was a problem hiding this comment.
Nice progress, added some more comments.
| @log_messages(self.hass, self.entity_id) | ||
| def handle_current_humidity_received(msg: ReceiveMessage) -> None: | ||
| """Handle current humidity coming via MQTT.""" | ||
| handle_climate_attribute_received( |
There was a problem hiding this comment.
Just for the record
It is okay to enable to setting the current humidity attribute, even if ClimateEntityFeature.TARGET_HUMIDITY is not set.
|
I had #84777 merged. This PR adds optimistic mode support to MQTT climate. You will have to rebase your PR. |
…d handle_temperature_received to handle_climate_attribute_received
…e actually setting it
…figured when setting CONF_HUMIDITY_STATE_TOPIC
f86c32d to
c56806a
Compare
jbouwh
left a comment
There was a problem hiding this comment.
Almost there, nice work! Left a few comments.
jbouwh
left a comment
There was a problem hiding this comment.
Looks nice, I left a suggestion for you to remove the validation on receiving the state target humidity as it is not needed.
I'll ask @emontnemery to have a look as well.
…y_received It's not needed because this is covered by the `valid_humidity_state_configuration` validation. Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
It is covered by the base Climate entity. Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
|
Thank you! And thanks for the review & the guidance you've provided! 🙂 I will update the documentation next. |
Proposed change
This change introduces two new variables to the MQTT Climate:
current_humidity_templateandcurrent_humidity_topic. These allow you to set the current humidity of the MQTT Climate, and work in a similar way tocurrent_temperature_templateandcurrent_temperature_topicrespectively.One benefit of this is that it allows other integrations to use this value. For example, it's possible to see the current humidity in Google Home with this change:
Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.To help with the load of incoming pull requests: