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

When changing: error about responsedata or responseheader is null. #13

Closed
glsf91 opened this issue Apr 1, 2019 · 0 comments
Closed
Labels
bug Something isn't working
Milestone

Comments

@glsf91
Copy link

glsf91 commented Apr 1, 2019

When changing something it is giving an error below which is disappearing too fast. Something about responsedata or responseheader is null.

I think it is caused by the following piece of code in RestClient.java:

  @Override
    protected void onPostExecute(Object o) {
        if(o instanceof String) {
            ResponseData responseData = null;

            switch (method) {
                case TYPE.GET.THERMOSTAT_INFO:
                    responseData = Converter.convertFromTemperature((String) o);
                    break;
                case TYPE.GET.ZWAVE_DEVICES:
                    responseData = Converter.convertFromDeviceInfo((String) o);
                    break;
                case TYPE.SET.SCHEME_STATE:
                    break;
                case TYPE.SET.SET_POINT:
                    break;
            }

            if (responseData != null && responseHandler != null) {
                responseHandler.onResponse(responseData);
            } else
                if (responseHandler != null) responseHandler.onResponseError(new NullPointerException("response data or responseHandler is null"));

In this part responseData will be always null when method TYPE.SET.SCHEME_STATE or TYPE.SET.SET_POINT is used.

@Inversion-NL Inversion-NL added the bug Something isn't working label Apr 2, 2019
This was referenced Apr 4, 2019
@Inversion-NL Inversion-NL reopened this Apr 9, 2019
@Inversion-NL Inversion-NL added this to the 0.5.4 milestone Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant