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

Unable to getAction for Wemo devices #36

Open
kgodett opened this issue Oct 17, 2022 · 0 comments
Open

Unable to getAction for Wemo devices #36

kgodett opened this issue Oct 17, 2022 · 0 comments

Comments

@kgodett
Copy link

kgodett commented Oct 17, 2022

I have been using this code to control Wemo devices, however run into an issue when calling Device.getAction(); which returns null and results in an inability to control the device.

The root of the issue appears to be in org.cybergarage.upnp.Device in the getAbsoluteURL(String, String, String) method. The method is called with:
urlString="/timesyncservice.xml"
baseURLString=""
locationURLStr="http://:49153/setup.xml"

The method returns a string: "http://:49153/setup.xml/timesyncservice.xml", which is incorrect. It should return "http://:49153/timesyncservice.xml". It appears the only validation that is being performed is to look for a MalformedURLException. My fix on the local copy of my code (attached) is to attempt to open the URL prior to returning the string to check for a response code of 200. Doing so appears to resolve my issue, though this approach breaks the test in org.cybergarage.upnp.DeviceTest as the testDeviceAbsoluteURL() method need to be able to connect to an actual device.
Device.txt

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

No branches or pull requests

1 participant