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

power: refactor component in order to dynamically import plugins #751

Closed
wants to merge 1 commit into from

Conversation

cedbossneo
Copy link

I think it's a good idea to make moonraker modulable in the same way as klippy does.

By adding new files in the extras/power directory, they are dynamically imported so we can have a plugin mechanism

@cedbossneo cedbossneo force-pushed the feature/power-modules branch from 1a86b7d to 38514d8 Compare November 19, 2023 10:41
… by adding them to the extras/power directory
@cedbossneo cedbossneo force-pushed the feature/power-modules branch from 38514d8 to b440d91 Compare November 19, 2023 10:44
@Arksine
Copy link
Owner

Arksine commented Nov 19, 2023

Moonraker's component system behaves in a similar (not identical) manner to that of Klippy's extras. That said, neither are intended to be used to support 3rd party plugins. Developers may choose to use them this way, but internal code changes to Moonraker could break the extension.

I don't think this PR is a good candidate for the main repo. While not officially supported, it is possible to create a 3rd party power component. The 3rd party code would load the power component and call its add_device() method. In the future I plan to consider official 3rd party plugin support, and this is the method in which a 3rd party power device would be added.

In addition, the power component supports generic http devices. Going forward I will tend to avoid merging new HTTP device implementations and instead direct users to configure the device using the generic type.

@cedbossneo
Copy link
Author

Ok, good to know, so i should create another repository that add the TPLink Tapo support (that was the mail goal of my two PRs).

@cedbossneo cedbossneo closed this Nov 19, 2023
@Arksine
Copy link
Owner

Arksine commented Nov 19, 2023

If you want you could create something like moonraker-timelapse. The install script creates a symbolic link to the python module in Moonraker's component folder and installs required dependencies, such as pycryptodome.

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

Successfully merging this pull request may close these issues.

2 participants