diff --git a/custom_components/octopus_energy/target_rates/target_rate.py b/custom_components/octopus_energy/target_rates/target_rate.py index d433fa55..8084d4ba 100644 --- a/custom_components/octopus_energy/target_rates/target_rate.py +++ b/custom_components/octopus_energy/target_rates/target_rate.py @@ -20,6 +20,12 @@ from ..const import ( CONFIG_TARGET_NAME, CONFIG_TARGET_HOURS, + CONFIG_TARGET_OLD_END_TIME, + CONFIG_TARGET_OLD_HOURS, + CONFIG_TARGET_OLD_MPAN, + CONFIG_TARGET_OLD_NAME, + CONFIG_TARGET_OLD_START_TIME, + CONFIG_TARGET_OLD_TYPE, CONFIG_TARGET_TYPE, CONFIG_TARGET_START_TIME, CONFIG_TARGET_END_TIME, @@ -214,6 +220,9 @@ async def async_added_to_hass(self): self._state = state.state self._attributes = {} for x in state.attributes.keys(): + if x in [CONFIG_TARGET_OLD_NAME, CONFIG_TARGET_OLD_HOURS, CONFIG_TARGET_OLD_TYPE, CONFIG_TARGET_OLD_START_TIME, CONFIG_TARGET_OLD_END_TIME, CONFIG_TARGET_OLD_MPAN]: + continue + self._attributes[x] = state.attributes[x] # Make sure our attributes don't override any changed settings