__convert_value_if_needed now also converts to float if needed

This commit is contained in:
Mose Müller 2023-12-05 10:20:12 +01:00
parent 5378396958
commit c3c1669cf9

View File

@ -220,6 +220,8 @@ class StateManager:
) -> Any:
if current_value_dict["type"] == "Quantity":
return u.convert_to_quantity(value, current_value_dict["value"]["unit"])
if current_value_dict["type"] == "float" and not isinstance(value, float):
return float(value)
return value
def __update_attribute_by_path(self, path: str, value: Any) -> None: