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

[tplinksmarthome] Add new device: EP25 #17377

Merged
merged 1 commit into from
Sep 6, 2024
Merged

Conversation

joshproehl
Copy link
Contributor

The Kasa EP25 appears to be a version of the KP125 that lacks the LED. Because of this, and per the comments in #16027, this simply copies the KP125, without the LED channel.

This is my attempt at contributing to this project, so I'm sure I've missed something. I haven't run any testing or build steps, all I've done is use the code that I saw in PR #1171 (Adding the KP125) as a template and add the EP25 device. I'm hoping this at least provides a base for someone more familiar with the project to do a quick review and test so we can get the device added! As mentioned in #16027, the EP25 appears to behave properly when added manually as a KP125 device, but that is the only testing that I've done, I have not figured out how to take this PR into my live OpenHAB environment to test it.

If accepted, this closes #16027

@joshproehl joshproehl requested a review from Hilbrand as a code owner September 6, 2024 15:01
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks, Left two minor comments. Kind of funny that you managed to get this PR this far without even building the code.
Not sure wich IDE you use, but if you got this far, the rest should not be that difficult. Let me know what steps you are missing. Once the build is completed, it will generate a JAR file.
After you uninstall the current binding in you openHAB setup, you can drop this JAR into your addons folder and your custom build binding verison should be started and is ready to test.

bundles/org.openhab.binding.tplinksmarthome/README.md Outdated Show resolved Hide resolved
bundles/org.openhab.binding.tplinksmarthome/README.md Outdated Show resolved Hide resolved
@joshproehl
Copy link
Contributor Author

Thanks, Left two minor comments.

I'll go in and try and get the table formatted. I'm struggling a little because my NeoVIM setup's Markdown linter wants to make some rather sweeping changes to the README file, but I can get that squared away. :-)

Kind of funny that you managed to get this PR this far without even building the code.

Duplicating a previous PR that does exactly the same thing can get you a long way.

After you uninstall the current binding in you openHAB setup, you can drop this JAR into your addons folder and your custom build binding verison should be started and is ready to test.

So I should remove the all the addons and run a complete build of the entire addons repo? Seems like perhaps I just need to spin up a 2nd OpenHAB instance, as that would be much easier. (I was hoping I could bump a version number and just build the tplinksmarthome portion of the bundle and have that take precedence...)
If I spin up an entire OpenHAB instance can I just build and deploy the tplinksmarthome portion of the bundle? (using mvn clean install -pl :org.openhab.binding.astro per the README.)

Other than running the standard integration tests, and confirming that my built bundle can recognize EP25's automatically and add/control them, are there any further tests I should be doing?

@lsiepel
Copy link
Contributor

lsiepel commented Sep 6, 2024

should remove the all the addons and run a complete build of the entire addons repo? Seems like perhaps I just need to spin up a 2nd Ope

r than running the standard integration tests, and confirming that my built bundle can recognize EP25's automatically and add/control them, are there any further tests I should be doing?

No need to build everything, just the one binding would be enough (like in the example you got from the docs). That will generate one jar that only holds that specific binding. No need for another openHAB instance. Uninstalling the binding will have no effect on your things/channels/items etc.

Edit: Oh and before we forget, the commit was not signed off, this is mandatory for openHAB.

@joshproehl joshproehl force-pushed the ep25 branch 2 times, most recently from c17dc8a to 72165c0 Compare September 6, 2024 18:07
The EP25 appears to be a version of the KP125 that lacks the LED.
Because of this, and per the comments in openhab#16027, this commit
mimics openhab#11771 and simply copies the KP125, without the LED channel.

Signed-off-by: Josh Proehl <josh@daedalusdreams.com>
@joshproehl
Copy link
Contributor Author

Per feedback I have fixed the whitespace issue in the README.md table, and have added the required sign-off text to the commit message. I have also pushed an additional fix to include the correct power channels, and have the name match the translations file. (I think I copied the wrong XML somehow...)

mvn spotless:check seems to pass fine.

I have built the modified tplinksmarthome binding using mvn clean install -pl :org.openhab.binding.tplinksmarthome and replaced my stock version of the binding with this snapshot version on my live OpenHAB instance.
So far it seems to be working. An EP25 was detected and automatically added to the inbox, and can be added and controlled, as well as show the correct wattage in the power channel as confirmed by checking the Kasa app.

If there are further checks I can do please let me know!

@joshproehl joshproehl requested a review from lsiepel September 6, 2024 18:49
Copy link
Contributor

@lsiepel lsiepel left a comment

Choose a reason for hiding this comment

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

Thanks for this contribution.
LGTM

@lsiepel lsiepel added the enhancement An enhancement or new feature for an existing add-on label Sep 6, 2024
@lsiepel lsiepel merged commit bb28e6a into openhab:main Sep 6, 2024
5 checks passed
@lsiepel lsiepel added this to the 4.3 milestone Sep 6, 2024
digitaldan pushed a commit to digitaldan/openhab-addons that referenced this pull request Sep 24, 2024
The EP25 appears to be a version of the KP125 that lacks the LED.
Because of this, and per the comments in openhab#16027, this commit
mimics openhab#11771 and simply copies the KP125, without the LED channel.

Signed-off-by: Josh Proehl <josh@daedalusdreams.com>
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
The EP25 appears to be a version of the KP125 that lacks the LED.
Because of this, and per the comments in openhab#16027, this commit
mimics openhab#11771 and simply copies the KP125, without the LED channel.

Signed-off-by: Josh Proehl <josh@daedalusdreams.com>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
The EP25 appears to be a version of the KP125 that lacks the LED.
Because of this, and per the comments in openhab#16027, this commit
mimics openhab#11771 and simply copies the KP125, without the LED channel.

Signed-off-by: Josh Proehl <josh@daedalusdreams.com>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
The EP25 appears to be a version of the KP125 that lacks the LED.
Because of this, and per the comments in openhab#16027, this commit
mimics openhab#11771 and simply copies the KP125, without the LED channel.

Signed-off-by: Josh Proehl <josh@daedalusdreams.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[tplinksmarthome] Add support for EP25
2 participants