Skip to content

Commit

Permalink
Round status light brightness number in HomeWizard (#132069)
Browse files Browse the repository at this point in the history
  • Loading branch information
DCSBL authored and frenck committed Dec 3, 2024
1 parent 3f1286b commit 895ffba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/homewizard/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ def native_value(self) -> float | None:
or (brightness := self.coordinator.data.state.brightness) is None
):
return None
return brightness_to_value((0, 100), brightness)
return round(brightness_to_value((0, 100), brightness))
4 changes: 2 additions & 2 deletions tests/components/homewizard/snapshots/test_number.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '100.0',
'state': '100',
})
# ---
# name: test_number_entities[HWE-SKT-11].1
Expand Down Expand Up @@ -106,7 +106,7 @@
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '100.0',
'state': '100',
})
# ---
# name: test_number_entities[HWE-SKT-21].1
Expand Down
2 changes: 1 addition & 1 deletion tests/components/homewizard/test_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async def test_number_entities(
assert snapshot == device_entry

# Test unknown handling
assert state.state == "100.0"
assert state.state == "100"

mock_homewizardenergy.state.return_value.brightness = None

Expand Down

0 comments on commit 895ffba

Please sign in to comment.