Skip to content

Commit

Permalink
Himox H06: add test for mapped speed being mapped to integer
Browse files Browse the repository at this point in the history
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
  • Loading branch information
make-all committed Dec 15, 2024
1 parent 4aed152 commit f4b0aa6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/devices/test_himox_h06_purifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def test_supported_features(self):
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)
Expand Down

0 comments on commit f4b0aa6

Please sign in to comment.