Skip to content

Commit

Permalink
Remove additional typecasts for number (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Jan 13, 2022
1 parent 9383933 commit f799ffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Version 0.20.1 (2022-01-13)
- Don't exclude Servicemeldungen from sysvars
- Use Servicemeldungen sysvar for hub state
- Add test for HM-CC-VG-1 (HM-Heatinggroup)
- Remove additional typecasts for number

Version 0.20.0 (2022-01-12)
- Add converter to BaseParameterEntity/GenericEntity
Expand Down
4 changes: 2 additions & 2 deletions hahomematic/platforms/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HmFloat(BaseNumber[float]):

async def send_value(self, value: float) -> None:
"""Set the value of the entity."""
if value is not None and float(self._min) <= float(value) <= float(self._max):
if value is not None and self._min <= float(value) <= self._max:
await super().send_value(value)
elif self._special:
if [sv for sv in self._special.values() if value == sv[ATTR_HM_VALUE]]:
Expand All @@ -69,7 +69,7 @@ class HmInteger(BaseNumber[int]):

async def send_value(self, value: int) -> None:
"""Set the value of the entity."""
if value is not None and int(self._min) <= int(value) <= int(self._max):
if value is not None and self._min <= int(value) <= self._max:
await super().send_value(value)
elif self._special:
if [sv for sv in self._special.values() if value == sv[ATTR_HM_VALUE]]:
Expand Down

0 comments on commit f799ffc

Please sign in to comment.