Skip to content

Commit

Permalink
Fix KeyError during removed device cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
elahd authored Jun 18, 2023
1 parent 887365c commit cb4ff2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion custom_components/alarmdotcom/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import asyncio
import contextlib
import json
import logging
import re
Expand Down Expand Up @@ -152,7 +153,8 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
f" {entity_entry.name,} (entity_entry.unique_id) ({adc_id})"
)

entity_registry.async_remove(entity_entry.id)
with contextlib.suppress(KeyError):
entity_registry.async_remove(entity_entry.id)

# Create virtual DEVICES.
# Currently, only Skybell cameras are virtual devices. We support modifying configuration attributes but not viewing video.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/alarmdotcom/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
"beautifulsoup4>=4.10.0",
"git+https://github.com/pyalarmdotcom/pyalarmdotcomajax.git@fix-missing-await#pyalarmdotcomajax==0.5.4-alpha.6"
],
"version": "3.0.5-alpha.6"
"version": "3.0.5-alpha.7"
}

0 comments on commit cb4ff2c

Please sign in to comment.