8181from ..homeassistant .const import WSEvent , WSType
8282from ..jobs .const import JobExecutionLimit
8383from ..jobs .decorator import Job
84- from ..resolution .const import UnhealthyReason
84+ from ..resolution .const import ContextType , IssueType , UnhealthyReason
85+ from ..resolution .data import Issue
8586from ..store .addon import AddonStore
8687from ..utils import check_port
8788from ..utils .apparmor import adjust_profile
@@ -144,11 +145,19 @@ def __init__(self, coresys: CoreSys, slug: str):
144145 self ._listeners : list [EventListener ] = []
145146 self ._startup_event = asyncio .Event ()
146147 self ._startup_task : asyncio .Task | None = None
148+ self ._boot_failed_issue = Issue (
149+ IssueType .BOOT_FAIL , ContextType .ADDON , reference = self .slug
150+ )
147151
148152 def __repr__ (self ) -> str :
149153 """Return internal representation."""
150154 return f"<Addon: { self .slug } >"
151155
156+ @property
157+ def boot_failed_issue (self ) -> Issue :
158+ """Get issue used if start on boot failed."""
159+ return self ._boot_failed_issue
160+
152161 @property
153162 def state (self ) -> AddonState :
154163 """Return state of the add-on."""
@@ -166,6 +175,13 @@ def state(self, new_state: AddonState) -> None:
166175 if new_state == AddonState .STARTED or old_state == AddonState .STARTUP :
167176 self ._startup_event .set ()
168177
178+ # Dismiss boot failed issue if present and we started
179+ if (
180+ new_state == AddonState .STARTED
181+ and self .boot_failed_issue in self .sys_resolution .issues
182+ ):
183+ self .sys_resolution .dismiss_issue (self .boot_failed_issue )
184+
169185 self .sys_homeassistant .websocket .send_message (
170186 {
171187 ATTR_TYPE : WSType .SUPERVISOR_EVENT ,
@@ -322,6 +338,13 @@ def boot(self, value: AddonBoot) -> None:
322338 """Store user boot options."""
323339 self .persist [ATTR_BOOT ] = value
324340
341+ # Dismiss boot failed issue if present and boot at start disabled
342+ if (
343+ value == AddonBoot .MANUAL
344+ and self ._boot_failed_issue in self .sys_resolution .issues
345+ ):
346+ self .sys_resolution .dismiss_issue (self ._boot_failed_issue )
347+
325348 @property
326349 def auto_update (self ) -> bool :
327350 """Return if auto update is enable."""
0 commit comments