2022-07-08 03:49:07 +00:00
|
|
|
"""Models for Resolution Center."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-07-12 17:26:06 +00:00
|
|
|
from typing import Protocol
|
|
|
|
|
|
|
|
from homeassistant import data_entry_flow
|
2022-07-08 03:49:07 +00:00
|
|
|
from homeassistant.backports.enum import StrEnum
|
2022-07-12 17:26:06 +00:00
|
|
|
from homeassistant.core import HomeAssistant
|
2022-07-08 03:49:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
class IssueSeverity(StrEnum):
|
|
|
|
"""Issue severity."""
|
|
|
|
|
|
|
|
CRITICAL = "critical"
|
|
|
|
ERROR = "error"
|
|
|
|
WARNING = "warning"
|
2022-07-12 17:26:06 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ResolutionCenterFlow(data_entry_flow.FlowHandler):
|
|
|
|
"""Handle a flow for fixing an issue."""
|
|
|
|
|
|
|
|
|
|
|
|
class ResolutionCenterProtocol(Protocol):
|
|
|
|
"""Define the format of resolution center platforms."""
|
|
|
|
|
|
|
|
async def async_create_fix_flow(
|
|
|
|
self, hass: HomeAssistant, issue_id: str
|
|
|
|
) -> ResolutionCenterFlow:
|
|
|
|
"""Create a flow to fix a fixable issue."""
|