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

ServiceProvider support #268

Merged
merged 5 commits into from Dec 29, 2020
Merged

ServiceProvider support #268

merged 5 commits into from Dec 29, 2020

Conversation

helto4real
Copy link
Collaborator

@helto4real helto4real commented Dec 29, 2020

Breaking change

Proposed change

Add the possiblity to access IServiceProvider interface through the app. That makes it possible to use built-in IoC to instance classes for easier testing.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the [development checklist][dev-checklist]
  • The code compiles without warnings (code quality chek)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@helto4real
Copy link
Collaborator Author

Since @BeeHiveJava requested this feature if you have time to review it I would be happy. I will merge in two days.

Copy link
Contributor

@BeeHiveJava BeeHiveJava left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! A future improvement would be to support constructor injection by using the service provider when creating apps (but as explained this can create scoping issues, so it might be better to explicitly not support it). But at least now it's possible to get dependencies at runtime within the execution of an app. Sweet.

@helto4real
Copy link
Collaborator Author

Looks good! A future improvement would be to support constructor injection by using the service provider when creating apps (but as explained this can create scoping issues, so it might be better to explicitly not support it). But at least now it's possible to get dependencies at runtime within the execution of an app. Sweet.

Thanks for taking the time... Lets make another issue for that.

@helto4real helto4real merged commit 4e5085e into dev Dec 29, 2020
@helto4real helto4real deleted the expose_service_provider branch December 29, 2020 15:15
Ikcelaks pushed a commit to Ikcelaks/netdaemon that referenced this pull request Dec 23, 2022
* ServiceProvider support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants