Remove invalid type hint and assignment in number (#122906)

This commit is contained in:
epenet 2024-07-31 20:51:24 +02:00 committed by GitHub
parent d878d744e7
commit 220f686078
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,6 @@ def async_check_significant_change(
if (device_class := new_attrs.get(ATTR_DEVICE_CLASS)) is None:
return None
absolute_change: float | None = None
percentage_change: float | None = None
# special for temperature
@ -83,11 +82,8 @@ def async_check_significant_change(
# Old state was invalid, we should report again
return True
if absolute_change is not None and percentage_change is not None:
if percentage_change is not None:
return _absolute_and_relative_change(
float(old_state), float(new_state), absolute_change, percentage_change
)
if absolute_change is not None:
return check_absolute_change(
float(old_state), float(new_state), absolute_change
)
return check_absolute_change(float(old_state), float(new_state), absolute_change)