Adjust tilt_position method in esphome cover (#74041)

pull/74099/head
epenet 2022-06-28 11:08:31 +02:00 committed by GitHub
parent 734b99e6ac
commit 38759bb98b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -125,8 +125,9 @@ class EsphomeCover(EsphomeEntity[CoverInfo, CoverState], CoverEntity):
"""Close the cover tilt."""
await self._client.cover_command(key=self._static_info.key, tilt=0.0)
async def async_set_cover_tilt_position(self, **kwargs: int) -> None:
async def async_set_cover_tilt_position(self, **kwargs: Any) -> None:
"""Move the cover tilt to a specific position."""
tilt_position: int = kwargs[ATTR_TILT_POSITION]
await self._client.cover_command(
key=self._static_info.key, tilt=kwargs[ATTR_TILT_POSITION] / 100
key=self._static_info.key, tilt=tilt_position / 100
)