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 target temperature low high to MQTT climate #17391

Closed
wants to merge 5 commits into from

Conversation

rwagoner
Copy link
Contributor

@rwagoner rwagoner commented Oct 13, 2018

Description:

Add support for target low and high temperature setpoints in MQTT climate.

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#6739

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

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

self.hass, self._topic[CONF_TEMPERATURE_LOW_COMMAND_TOPIC],
kwargs.get(ATTR_TARGET_TEMP_LOW), self._qos, self._retain)
mqtt.async_publish(
self.hass, self._topic[CONF_TEMPERATURE_HIGH_COMMAND_TOPIC],

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)


if self._topic[CONF_TEMPERATURE_HIGH_STATE_TOPIC] is None:
# optimistic mode
self._target_high_temperature = kwargs.get(ATTR_TARGET_TEMP_HIGH)

Choose a reason for hiding this comment

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

line too long (81 > 79 characters)

@@ -225,7 +247,8 @@ class MqttClimate(MqttAvailability, MqttDiscoveryUpdate, ClimateDevice):

def __init__(self, hass, name, topic, value_templates, qos, retain,
mode_list, fan_mode_list, swing_mode_list,
target_temperature, away, hold, current_fan_mode,
target_temperature, target_temperature_low, target_temperature_high,

Choose a reason for hiding this comment

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

line too long (85 > 79 characters)

@@ -91,6 +101,8 @@
vol.Optional(CONF_POWER_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_MODE_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_LOW_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_HIGH_STATE_TOPIC): mqtt.valid_subscribe_topic,

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)

@@ -82,6 +90,8 @@
vol.Optional(CONF_POWER_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_MODE_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_LOW_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_HIGH_COMMAND_TOPIC): mqtt.valid_publish_topic,

Choose a reason for hiding this comment

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

line too long (80 > 79 characters)

vol.Optional(CONF_TEMPERATURE_LOW_STATE_TOPIC):
mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_HIGH_STATE_TOPIC):
mqtt.valid_subscribe_topic,

Choose a reason for hiding this comment

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

continuation line unaligned for hanging indent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how else to indent these as otherwise the line will be too long.

@@ -91,6 +101,10 @@
vol.Optional(CONF_POWER_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_MODE_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_STATE_TOPIC): mqtt.valid_subscribe_topic,
vol.Optional(CONF_TEMPERATURE_LOW_STATE_TOPIC):
mqtt.valid_subscribe_topic,

Choose a reason for hiding this comment

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

continuation line unaligned for hanging indent

vol.Optional(CONF_TEMPERATURE_LOW_COMMAND_TOPIC):
mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_HIGH_COMMAND_TOPIC):
mqtt.valid_publish_topic,

Choose a reason for hiding this comment

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

continuation line unaligned for hanging indent

@@ -82,6 +90,10 @@
vol.Optional(CONF_POWER_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_MODE_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_COMMAND_TOPIC): mqtt.valid_publish_topic,
vol.Optional(CONF_TEMPERATURE_LOW_COMMAND_TOPIC):
mqtt.valid_publish_topic,

Choose a reason for hiding this comment

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

continuation line unaligned for hanging indent

@balloob
Copy link
Member

balloob commented Nov 27, 2018

Wouldn't it make more sense to send it over 1 topic? That way it will always stay in sync.

@balloob
Copy link
Member

balloob commented Dec 14, 2018

This PR seems to have gone stale. Closing it.

@balloob balloob closed this Dec 14, 2018
@ghost ghost removed the in progress label Dec 14, 2018
@joshtbernstein
Copy link

joshtbernstein commented Dec 16, 2018

@balloob What would be needed to move this forward?

@rwagoner
Copy link
Contributor Author

rwagoner commented Dec 16, 2018

Sending over low and high in one mqtt topic might not work for all mqtt devices. With then broken out in home assisstant you have the possibility to use a value template to grab both from one mqtt topic.

@joshtbernstein
Copy link

@rwagoner think we can get this opened back up? I could really use this in my setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants