Improve IntegerTypeData scaling in Tuya (#156507)

This commit is contained in:
epenet
2025-11-13 20:29:07 +01:00
committed by GitHub
parent 214731e964
commit c9c518ee84
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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}]
)