mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-10-28 00:20:49 +08:00
fix: value precision (#1623)
This commit is contained in:
@@ -617,7 +617,8 @@ class MIoTSpecProperty(_MIoTSpecBase):
|
|||||||
if self.value_range is None:
|
if self.value_range is None:
|
||||||
return int(round(value))
|
return int(round(value))
|
||||||
return int(
|
return int(
|
||||||
round(value / self.value_range.step) * self.value_range.step)
|
round((value - self.value_range.min_) / self.value_range.step) *
|
||||||
|
self.value_range.step + self.value_range.min_)
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def dump(self) -> dict:
|
def dump(self) -> dict:
|
||||||
|
|||||||
Reference in New Issue
Block a user