diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/cover/mqtt.py index 8cc80c52bc5f..235b28b5be2a 100644 --- a/homeassistant/components/cover/mqtt.py +++ b/homeassistant/components/cover/mqtt.py @@ -87,7 +87,7 @@ def validate_options(value): if (CONF_SET_POSITION_TOPIC in value and CONF_GET_POSITION_TOPIC not in value): raise vol.Invalid( - "Set position topic must be set together with get position topic.") + "set_position_topic must be set together with position_topic.") return value @@ -287,7 +287,7 @@ def position_message_received(topic, payload, qos): float(payload), COVER_PAYLOAD) if 0 <= percentage_payload <= 100: self._position = percentage_payload - self._state = self._position == 0 + self._state = self._position == self._position_closed else: _LOGGER.warning( "Payload is not integer within range: %s", @@ -451,7 +451,7 @@ async def async_set_cover_position(self, **kwargs): mqtt.async_publish(self.hass, self._set_position_topic, position, self._qos, self._retain) if self._optimistic: - self._state = percentage_position == 0 + self._state = percentage_position == self._position_closed self._position = percentage_position self.async_schedule_update_ha_state()