jneilliii / OctoPrint-TPLinkSmartplug

106 stars 57 forks source link

[BUG]: getAdditionalData hook overrides other plugin #325

Closed larsjuhw closed 1 year ago

larsjuhw commented 1 year ago

Hi, This plugin overwrites the filesViewModel.getAdditionalData function to display the power cost of the last print in the file information view. However, my plugin ExtraFileInfo also hooks that same function meaning the plugins can not work together as described here https://github.com/larsjuhw/OctoPrint-ExtraFileInfo/issues/12. The ExtraFileInfo plugin loads first meaning TPLinkSmartplug overrides the hook.

Could you consider appending to the existing getAdditionalData function instead of overwriting it, so that our plugins do not conflict?

jneilliii commented 1 year ago

I'd be more than happy to work through this with you. Is that how your plugin is doing it? I can look at its implementation and adjust mine the same if that is the case.

jneilliii commented 1 year ago

Thanks for your links and how you're doing it in your plugin. That definitely seems to be a cleaner approach and I will add those changes to this plugin for next release.

jneilliii commented 1 year ago

Should be fixed in the above commit and available as version 1.0.3rc2. Change the release channel in OctoPrint's Software Update settings for the plugin to Release Candidate and update when prompted.

larsjuhw commented 1 year ago

Wow that was quick. Thank you very much!