Skip to content

Commit

Permalink
Add HacsBase.__init__ (#3566)
Browse files Browse the repository at this point in the history
* Add HacsBase.__init__

* Address review comments

---------

Co-authored-by: Joakim Sørensen <[email protected]>
  • Loading branch information
emontnemery and ludeeus authored Apr 10, 2024
1 parent d92db61 commit ff00c18
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions custom_components/hacs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,28 +355,31 @@ def removed_repository(self, repository_full_name: str) -> RemovedRepository:
class HacsBase:
"""Base HACS class."""

common = HacsCommon()
configuration = HacsConfiguration()
core = HacsCore()
data: HacsData | None = None
data_client: HacsDataClient | None = None
frontend_version: str | None = None
github: GitHub | None = None
githubapi: GitHubAPI | None = None
hass: HomeAssistant | None = None
integration: Integration | None = None
log: logging.Logger = LOGGER
queue: QueueManager | None = None
recuring_tasks = []
repositories: HacsRepositories = HacsRepositories()
repository: AIOGitHubAPIRepository | None = None
session: ClientSession | None = None
stage: HacsStage | None = None
status = HacsStatus()
system = HacsSystem()
validation: ValidationManager | None = None
version: AwesomeVersion | None = None

def __init__(self) -> None:
"""Initialize."""
self.common = HacsCommon()
self.configuration = HacsConfiguration()
self.core = HacsCore()
self.log = LOGGER
self.recuring_tasks: list[Callable[[], None]] = []
self.repositories = HacsRepositories()
self.status = HacsStatus()
self.system = HacsSystem()

@property
def integration_dir(self) -> pathlib.Path:
"""Return the HACS integration dir."""
Expand Down

0 comments on commit ff00c18

Please sign in to comment.