mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-09-13 17:53:32 +08:00
fix: integer value step (#1388)
This commit is contained in:
@ -601,7 +601,10 @@ class MIoTSpecProperty(_MIoTSpecBase):
|
||||
if value is None:
|
||||
return None
|
||||
if self.format_ == int:
|
||||
return int(round(value))
|
||||
if self.value_range is None:
|
||||
return int(round(value))
|
||||
return int(
|
||||
round(value / self.value_range.step) * self.value_range.step)
|
||||
if self.format_ == float:
|
||||
return round(value, self.precision)
|
||||
if self.format_ == bool:
|
||||
|
Reference in New Issue
Block a user