Skip to content

Commit

Permalink
Fix deletion of repairs/issues
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiteixeira committed May 19, 2024
1 parent 8d55338 commit 702bc7e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions custom_components/proxmoxve/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from homeassistant.helpers.issue_registry import (
IssueSeverity,
async_create_issue,
async_delete_issue,
delete_issue,
)

from .const import (
Expand Down Expand Up @@ -168,7 +168,7 @@ def post_api_command(
f"Proxmox {resource} {command} error - {error}",
) from error

async_delete_issue(
delete_issue(
self.hass,
DOMAIN,
issue_id,
Expand Down
13 changes: 6 additions & 7 deletions custom_components/proxmoxve/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from homeassistant.helpers.issue_registry import (
IssueSeverity,
async_create_issue,
async_delete_issue,
delete_issue,
)
from homeassistant.helpers.typing import UNDEFINED, UndefinedType
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
Expand Down Expand Up @@ -792,6 +792,11 @@ def permission_to_resource(
return "Unmapped"

try:
delete_issue(
hass,
DOMAIN,
f"{config_entry.entry_id}_{resource_id}_forbiden",
)
return get_api(proxmox, api_path)
except AuthenticationError as error:
raise ConfigEntryAuthFailed from error
Expand Down Expand Up @@ -824,9 +829,3 @@ def permission_to_resource(
)
return None
raise UpdateFailed from error

async_delete_issue(
hass,
DOMAIN,
f"{config_entry.entry_id}_{resource_id}_forbiden",
)

0 comments on commit 702bc7e

Please sign in to comment.