Tuya fan percentage fix (#65225)
This commit is contained in:
parent
80da5c52ae
commit
9b5757dff5
1 changed files with 3 additions and 3 deletions
|
@ -137,7 +137,7 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
|
|||
[
|
||||
{
|
||||
"code": self._speed.dpcode,
|
||||
"value": int(self._speed.remap_value_from(percentage, 0, 100)),
|
||||
"value": int(self._speed.remap_value_from(percentage, 1, 100)),
|
||||
}
|
||||
]
|
||||
)
|
||||
|
@ -178,7 +178,7 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
|
|||
commands.append(
|
||||
{
|
||||
"code": self._speed.dpcode,
|
||||
"value": int(self._speed.remap_value_from(percentage, 0, 100)),
|
||||
"value": int(self._speed.remap_value_from(percentage, 1, 100)),
|
||||
}
|
||||
)
|
||||
return
|
||||
|
@ -248,7 +248,7 @@ class TuyaFanEntity(TuyaEntity, FanEntity):
|
|||
if self._speed is not None:
|
||||
if (value := self.device.status.get(self._speed.dpcode)) is None:
|
||||
return None
|
||||
return int(self._speed.remap_value_to(value, 0, 100))
|
||||
return int(self._speed.remap_value_to(value, 1, 100))
|
||||
|
||||
if self._speeds is not None:
|
||||
if (value := self.device.status.get(self._speeds.dpcode)) is None:
|
||||
|
|
Loading…
Add table
Reference in a new issue