Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #495 from prairiesnpr/dev
Browse files Browse the repository at this point in the history
Don't raise keyerror during migration, if missing camera key
  • Loading branch information
Thomas55555 authored Jun 20, 2023
2 parents 3d8be13 + 1d629f6 commit 26c2d04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/husqvarna_automower/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ async def async_migrate_entry(hass, config_entry: ConfigEntry):
MOWER_IMG_PATH,
MAP_IMG_PATH,
]:
new_options.pop(opt_key)
new_options.pop(opt_key, None)

config_entry.version = CURRENT_CONFIG_VER
hass.config_entries.async_update_entry(config_entry, options=new_options)
Expand Down
4 changes: 3 additions & 1 deletion custom_components/husqvarna_automower/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,9 @@ async def async_step_camera_config(self, user_input=None):
]
else:
errors[HOME_LOCATION] = pnt_error
self.options[self.sel_mower_id][ADD_CAMERAS] = user_input.get(ADD_CAMERAS)
self.options[self.sel_mower_id][ADD_CAMERAS] = user_input.get(
ADD_CAMERAS, []
)

if not errors:
return await self._update_config()
Expand Down

0 comments on commit 26c2d04

Please sign in to comment.