-
Notifications
You must be signed in to change notification settings - Fork 45
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
Error while looking for presence #21
Comments
I have the exact same issue when looking for presence.
I have only one device attached to my smartthings account, my iphone as presence sensor. |
I've deleted everything and rebuilt it following the guide and now the error is gone, so I guess it was my bad. Nevertheless now I always get an empty list each time I'm trying to list my |
Figured it out (sorry, I'm new to smartthings). def jd = [id: device.id, label: device.label, type: type, value: vd, hub: device.hub.name]; I only have one device connected to my smartthings hub, my phone which is of type def hub_name = "None"
if (device.hub) {
hub_name = device.hub.name
}
def jd = [id: device.id, label: device.label, type: type, value: vd, hub: hub_name]; And it seems to be working well. |
Great. It's been a long time since I looked at this code, can't you just do something like this in Groovy def jd = [id: device.id, label: device.label, type: type, value: vd, hub: device.hub?.name]; |
@dpjanes Yes, it will. It's my first time playing around with Groovy. It's also the first time I'm trying my SmartThings hub, Your repository really helped me wrap my head around it. |
This is actually my first and only Groovy code. If you've tested that little code snippet with the |
Yes. I've just tested it. |
Cheers! |
Traceback (most recent call last):
File "smartthings.py", line 209, in
ds = st.request_devices(options.device_type)
File "smartthings.py", line 119, in request_devices
SmartThings.raise_api_errors(self.deviceds)
File "smartthings.py", line 55, in raise_api_errors
raise Exception(error_type + ": " + error_message)
Exception: java.lang.NullPointerException: An unexpected error occurred.
The text was updated successfully, but these errors were encountered: