mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Fix custom position range (#36222)
This commit is contained in:
parent
7e693afcf3
commit
31250eafe8
@ -530,7 +530,7 @@ class MqttCover(
|
|||||||
|
|
||||||
async def async_set_cover_tilt_position(self, **kwargs):
|
async def async_set_cover_tilt_position(self, **kwargs):
|
||||||
"""Move the cover tilt to a specific position."""
|
"""Move the cover tilt to a specific position."""
|
||||||
position = float(kwargs[ATTR_TILT_POSITION])
|
position = kwargs[ATTR_TILT_POSITION]
|
||||||
|
|
||||||
# The position needs to be between min and max
|
# The position needs to be between min and max
|
||||||
level = self.find_in_range_from_percent(position)
|
level = self.find_in_range_from_percent(position)
|
||||||
@ -550,10 +550,7 @@ class MqttCover(
|
|||||||
percentage_position = position
|
percentage_position = position
|
||||||
if set_position_template is not None:
|
if set_position_template is not None:
|
||||||
position = set_position_template.async_render(**kwargs)
|
position = set_position_template.async_render(**kwargs)
|
||||||
elif (
|
else:
|
||||||
self._config[CONF_POSITION_OPEN] != 100
|
|
||||||
and self._config[CONF_POSITION_CLOSED] != 0
|
|
||||||
):
|
|
||||||
position = self.find_in_range_from_percent(position, COVER_PAYLOAD)
|
position = self.find_in_range_from_percent(position, COVER_PAYLOAD)
|
||||||
|
|
||||||
mqtt.async_publish(
|
mqtt.async_publish(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user