Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor modules to use base classes #94

Open
sjefferson99 opened this issue Apr 18, 2024 · 1 comment
Open

Refactor modules to use base classes #94

sjefferson99 opened this issue Apr 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sjefferson99
Copy link
Owner

In the environment module, a list of all modules used by the environment module is created called "modules" and a subset is also created called "service_modules".

Modules have the common method available: get_all_data(). This should be created in a base class to reliably provide this to the "all_data" API method and also act as a structure with docstring to show that modules can have this function to offer any attributes up to the all data API endpoint.

Equally the service_module should extend the module base class where the module as a service that can be loaded into the async loop for similar reasons above.

Can then have service_modules be automatically created from modules based on this being present.

@sjefferson99 sjefferson99 added the enhancement New feature or request label Apr 18, 2024
@sjefferson99
Copy link
Owner Author

Best to have environment build a list of all modules and then have init_modules parse all module but have an if has attr init_service to only call the method if it exists.

base service class will have init_service and output some logging, extended classes can call super() and then execute further module specific service init code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant