Remove invalid type hint and assignment in number (#122906)
This commit is contained in:
parent
d878d744e7
commit
220f686078
1 changed files with 2 additions and 6 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue