Author Topic: Is there a 'Proper' way to modify some elses plug-in?  (Read 493 times)

Offline Jim McGhee

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-1
Is there a 'Proper' way to modify some elses plug-in?
« on: September 01, 2017, 01:30:20 pm »
Here's my problem:
Cybrmage hasn't made a post since Febauary.  See:

Cybrmage - we miss you!
http://forum.micasaverde.com/index.php/topic,49859.0.html

Cybrmage posted updates to his Wink plugin and his ECO Switch (now 'WiFi UDP Switch Controller') in July.  Unfortunately, the new ECO Switch plugin fails to initialize on my Vera Plus.

I took the liberty of downloading the files and commenting out the aggressive discovery so it does initialize on my Vera.
In the process, I discovered the new version is designed to work with not only the ECO Switch but also the TP-LINK Switch, the TP-LINK LB100(US) and LB120(US) bulbs, and the SENGLED Boost bulb/wifi extender!!!
I have a LOT of ECO and TP-LINK switches.

The two switches worked fine but I had to make changes to the code for the bulbs to get them to work.  The Boost is not quite working yet (just got one yesterday).

Now for my problem...
Due to the traffic on the ECO Plugs thread:

http://forum.micasaverde.com/index.php/topic,35997.0.html

I feel that people are interest in this plugin and I would like to make my changes available for people to test but I don't want to step on anyone's toes.

Thus my question: What is the 'Proper' way to modify some elses plug-in?

Cybrmage designed this plugin very well and the last thing I want to do is offend him or anyone else.
I PMed him a couple of weeks ago, but no response.
If I could find the code on GitHub, I'd just do a pull request.
I'd post mmy changes on GitHub but feel uncomfortable making someone elses code public without their knowledge/permission.
Also, since I don't know LUA, Javascript, json, or LUUP, it would be nice to have SOMEONE look at my changes before I expose them to the world.

Looking forward to hearing any comments/suggestions.

Offline gibby

  • Full Member
  • ***
  • Posts: 184
  • Karma: +3/-1
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #1 on: September 01, 2017, 05:13:25 pm »
Does his code have any licences at the top of it?

Offline Jim McGhee

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-1
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #2 on: September 01, 2017, 11:25:48 pm »
Thanks gibby for the quick response.
J_ECO_Switch1.js has this comment at the top:
/*
 * Plugin for Belkin WeMo
 * Copyright (C) 2009-2011 Deborah Pickett

 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License...

None of the rest of the files have a license disclaimer.
Since I got these files by downloading them from my Vera Plus, I don't have access to the license file that they came with.  I looked on GitHub but didn't fine the sources there.
Does this answer your question?

Offline gibby

  • Full Member
  • ***
  • Posts: 184
  • Karma: +3/-1
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #3 on: September 02, 2017, 12:46:58 pm »

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3247
  • Karma: +188/-9
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #4 on: September 02, 2017, 07:07:32 pm »
Hi Jim,

That's my name at the top of the commented file. For that one file, you have my explicit permission and blessing to make any edits you like provided that you adhere to the GPL. All the files in my WeMo plugin are GPL and anything made from them is a "derivative work" and must be GPL licensed too.

Of course, it's the other files you care about. You could argue that Cybrmage's plugin as a whole is a derivative work of my WeMo plugin by virtue of it containing one of my files. That's a very strict lawyers-at-thirty-paces interpretation of the GPL but this "viral" effect of the GPL is a deliberate part of the licence.

If I were in your position, I would make the necessary edits to Cybrmage's code but put clear comments at the top of each file giving him credit for the original code. I would let my revision control system (GitHub) take care of tracking which code is mine and which is his. I would be prepared to take down my repository if asked to by one of the original copyright holders. Only the copyright holders can make you remove your derivative work!

In an ideal world, Cybrmage returns to the community and accepts your changes into the plugin. One alternative future is that he returns to the community and makes you take down your derived work. You have to make a judgement call as to how likely that is. Another alternative future is that he doesn't return to the community at all. I'd be sad about that, but the consequence for your derivative work is that it would continue to be available because no copyright holder objects to it being available.

License your edits! You can't change the implied copyright of Cybrmage's code, but you can apply the GPL to your contributions. Mixed-licence files are messy but that's why we have revision control systems to track who did what.

obDisclaimers: I am not a lawyer, I am not a resident of your legal jurisdiction, etc etc

Offline Jim McGhee

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-1
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #5 on: September 03, 2017, 07:09:48 pm »
Thanks gibby for  the pointer to the GPL.
And thanks futzle for the very thorough response to my query.

I've created a project on GitHub at:

https://github.com/jimcghee/NotMy-Wifi-UDP-Switch-Controller

The 'master' branch is the unaltered version 1.9 files I started with.
I added the LICENSE file I found in your WEMO project to the 'Initialization-Fix' branch since I wanted to leave the master branch virgin.

If I understand you correctly, you suggest I add a 'not my original code' and the GNU disclaimer to the top of each of the files I change.  If so, I'll add this to the one changed file I've posted so far.  I assume I put my name on these new changes but what about the file that already has a GNU disclaimer with your name?

Also, I'm not seeing any response to my post on the ECO Plug thread at:

http://forum.micasaverde.com/index.php/topic,35997.0.html

Should I start a new thread?

Thanks again for your help.

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3247
  • Karma: +188/-9
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #6 on: September 03, 2017, 10:46:35 pm »
I assume I put my name on these new changes but what about the file that already has a GNU disclaimer with your name?

Add yours too. You can't remove names because they still own copyright to parts of the file. You're not changing the licence so the rest of the comment will stay the same.

Offline Jim McGhee

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +1/-1
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #7 on: September 05, 2017, 11:38:06 pm »
Thanks again for all the help.  I've uploaded the latest changes along with the GPL to:

https://github.com/jimcghee/NotMy-Wifi-UDP-Switch-Controller

I would appreciate it if you would glance at it and let me know if the GPL stuff is what you described.

Next: tackle the README.  I HATE documentation.

Can someone suggest where I should post the announcement of the new and improved ECO Switch/WiFi UDP Switch Controller plugin?

Offline futzle

  • Beta Testers
  • Master Member
  • *****
  • Posts: 3247
  • Karma: +188/-9
Re: Is there a 'Proper' way to modify some elses plug-in?
« Reply #8 on: September 06, 2017, 03:43:25 am »
I would appreciate it if you would glance at it and let me know if the GPL stuff is what you described.

Looks stellar. Good work.