-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from PinoutLTD/rrs-0.1
Robonomics Report Service v 0.1
- Loading branch information
Showing
19 changed files
with
567 additions
and
704 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
custom_components/robonomics_report_service/error_sources/error_source_manager.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import typing as tp | ||
|
||
from homeassistant.core import HomeAssistant, callback | ||
|
||
from .sources.entities_checker import EntitiesStatusChecker | ||
from .sources.error_source import ErrorSource | ||
from .sources.logger_handler import LoggerHandler | ||
|
||
class ErrorSourcesManager: | ||
def __init__(self, hass: HomeAssistant): | ||
self.error_sources: tp.List[ErrorSource] = [EntitiesStatusChecker(hass), LoggerHandler(hass)] | ||
|
||
@callback | ||
def setup_sources(self) -> None: | ||
for source in self.error_sources: | ||
source.setup() | ||
|
||
@callback | ||
def remove_sources(self) -> None: | ||
for source in self.error_sources: | ||
source.remove() |
Oops, something went wrong.