diff --git a/custom_components/hilo/__init__.py b/custom_components/hilo/__init__.py index eb79a95..f63ad40 100644 --- a/custom_components/hilo/__init__.py +++ b/custom_components/hilo/__init__.py @@ -415,13 +415,13 @@ def set_state(self, entity, state, new_attrs={}, keep_state=False, force=False): attrs = {} attrs["last_update"] = datetime.now() else: - attrs = current.as_dict()["attributes"] + attrs = current.as_dict()["attributes"] LOG.debug(f"Setting state {params} {current}") - attrs = {**attrs, **new_attrs} + attrs = {**attrs, **new_attrs} if keep_state and current: - state = current.state + state = current.state if "Cost" in attrs: - attrs["Cost"] = state + attrs["Cost"] = state self._hass.states.async_set(entity, state, attrs) @property