mirror of
https://github.com/home-assistant/core.git
synced 2026-09-05 02:25:07 -05:00
Improve IntegerTypeData scaling in Tuya (#156507)
This commit is contained in:
@@ -61,7 +61,7 @@ class IntegerTypeData(TypeInformation):
|
||||
|
||||
def scale_value_back(self, value: float) -> int:
|
||||
"""Return raw value for scaled."""
|
||||
return int(value * (10**self.scale))
|
||||
return round(value * (10**self.scale))
|
||||
|
||||
def remap_value_to(
|
||||
self,
|
||||
|
||||
@@ -68,7 +68,7 @@ async def test_set_temperature(
|
||||
blocking=True,
|
||||
)
|
||||
mock_manager.send_commands.assert_called_once_with(
|
||||
mock_device.id, [{"code": "temp_set", "value": 22}]
|
||||
mock_device.id, [{"code": "temp_set", "value": 23}]
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user