浏览代码

Himox H06: add test for mapped speed being mapped to integer

When mapping specifies an integer without quotes, we expect the result of
the mapping to be an integer, even if the dps type was string.

User reports that percentage is not working correctly when they map from
string values, but it is not what was expected.

PR #2586
Jason Rumney 1 年之前
父节点
当前提交
f4b0aa62c5
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      tests/devices/test_himox_h06_purifier.py

+ 1 - 0
tests/devices/test_himox_h06_purifier.py

@@ -103,6 +103,7 @@ class TestHimoxH06Purifier(
     def test_speed(self):
         self.dps[SPEED_DPS] = "low"
         self.assertEqual(self.subject.percentage, 33)
+        self.assertEqual(type(self.subject.percentage), int)
 
     def test_speed_step(self):
         self.assertAlmostEqual(self.subject.percentage_step, 33, 0)