mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 10:47:10 +00:00
Remove invalid type hint and assignment in number (#122906)
This commit is contained in:
parent
d878d744e7
commit
220f686078
@ -44,7 +44,6 @@ def async_check_significant_change(
|
|||||||
if (device_class := new_attrs.get(ATTR_DEVICE_CLASS)) is None:
|
if (device_class := new_attrs.get(ATTR_DEVICE_CLASS)) is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
absolute_change: float | None = None
|
|
||||||
percentage_change: float | None = None
|
percentage_change: float | None = None
|
||||||
|
|
||||||
# special for temperature
|
# special for temperature
|
||||||
@ -83,11 +82,8 @@ def async_check_significant_change(
|
|||||||
# Old state was invalid, we should report again
|
# Old state was invalid, we should report again
|
||||||
return True
|
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(
|
return _absolute_and_relative_change(
|
||||||
float(old_state), float(new_state), absolute_change, percentage_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…
x
Reference in New Issue
Block a user