Skip to content

Commit

Permalink
Fix configuration migration process
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-bar committed Oct 13, 2022
1 parent e5807fe commit aaa2cc8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.9

- Fix configuration migration process

## 2.0.8

- Removed port from configuration as it's not being used
Expand Down
7 changes: 5 additions & 2 deletions custom_components/edgeos/component/managers/home_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,12 @@ async def async_initialize_data_providers(self):
updated = False

if self._entry is not None:
entry_options = self._entry.options.__dict__
migration_data = {}
entry_options = self._entry.options

migration_data = {} if entry_options is None else entry_options
if entry_options is not None:
for option_key in entry_options:
migration_data[option_key] = entry_options.get(option_key)

if self._entry.data is not None:
migration_data[STORAGE_DATA_UNIT] = self._entry.data.get(STORAGE_DATA_UNIT)
Expand Down
2 changes: 1 addition & 1 deletion custom_components/edgeos/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"codeowners": ["@elad-bar"],
"requirements": ["aiohttp"],
"config_flow": true,
"version": "2.0.8",
"version": "2.0.9",
"iot_class": "local_polling"
}

0 comments on commit aaa2cc8

Please sign in to comment.