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

[radiothermostat] RadioThermostat Binding - initial contribution #7266

Merged
merged 36 commits into from
Jun 24, 2020

Conversation

mlobstein
Copy link
Contributor

This binding connects RadioThermostat/3M Filtrete models CT30, CT50/3M50, CT80, etc. with built-in Wi-Fi module using its HTTP/JSON interface.

@TravisBuddy
Copy link

Travis tests have failed

Hey @mlobstein,
please read the following log in order to understand the failure reason. There might also be some helpful tips along the way.
It will be awesome if you fix what is wrong and commit the changes.

Signed-off-by: Michael Lobstein <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister changed the title /RadioThermostat Binding - initial contribution [radiothermostat] RadioThermostat Binding - initial contribution Apr 2, 2020
@cpmeister cpmeister added the new binding If someone has started to work on a binding. For a new binding PR. label Apr 2, 2020
@billfor
Copy link
Contributor

billfor commented Apr 8, 2020

The RadioThermostat supports a type of SSDP discovery so you don't need to add each one manually. While stuck at home I wrote a binding for it, and if you want you can take the discovery portion of that or I can try to merge it in with your thing.

See here: https://github.com/billfor/openhab2-addons/blob/radiotherm/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/discovery/RadioThermostatDiscoveryService.java

Signed-off-by: Michael Lobstein <[email protected]>
@mlobstein mlobstein requested a review from a team as a code owner April 8, 2020 04:43
@mlobstein
Copy link
Contributor Author

The RadioThermostat supports a type of SSDP discovery so you don't need to add each one manually. While stuck at home I wrote a binding for it, and if you want you can take the discovery portion of that or I can try to merge it in with your thing.

Thanks! I added it to the PR!

@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@billfor
Copy link
Contributor

billfor commented Apr 20, 2020

Would it make any sense to augment this:

Number Therm_yhh "Yesterday's Heating Hours [%s]" { channel="radiothermostat:rtherm:mytherm1:yesterday_heat_hour" } Number Therm_yhm "Yesterday's Heating Minutes [%s]" { channel="radiothermostat:rtherm:mytherm1:yesterday_heat_minute" }

With something like this:
Number:Time RuntimeYesterdayHeat "Office [%d %unit%]" <time> (gtemps) { channel="radiothermostat:thermostat:88308a278ce3:heatRuntimeYesterday" }

As often as I've been using the RadioThermostat, all I've wanted to do really with these values is store away the runtimes and look at them on a group graph. Having a channel that provides a single number would avoid doing transformations to persist the single value needed.

@mlobstein
Copy link
Contributor Author

As often as I've been using the RadioThermostat, all I've wanted to do really with these values is store away the runtimes and look at them on a group graph. Having a channel that provides a single number would avoid doing transformations to persist the single value needed.

Yeah that is a good idea. I was originally thinking in terms of just exposing the data from the json api directly to provide compatibility with rule based scraping of the json data that many have done with this thermostat over the years. That also why I put in the channels to provide the thermostat time from the json data even though it is mostly redundant. What unit of time should this single number be? Minutes perhaps? For heat today, I would do the following (today_heat_hour * 60) + today_heat_minute = RuntimeTodayHeat (minutes). Does that sound good?

@billfor
Copy link
Contributor

billfor commented Apr 20, 2020

Yeah just

        public int getUsage() {
            return hour * 60 + minute;
        }

and to store it, you could use

        updateState(CHANNEL_HEAT_RUNTIME_YESTERDAY, new QuantityType<>(heat_usage, SmartHomeUnits.MINUTE));
        updateState(CHANNEL_COOL_RUNTIME_YESTERDAY, new QuantityType<>(cool_usage, SmartHomeUnits.MINUTE));

That way, expressed as Number:Time, the user can change the representation as they need.

There is one other thing that might be important due to the way these thermostats work. When these guys are in HOLD at a setpoint, you can't transition to a temporary value without unholding it. Other times you may want to set a value and HOLD it. So the way you have things now I think that would be two commands. Since the thermostat can take the json string, I have a simple channel called "command"

that just checks and passes that to the thermostat, eg:
BedroomCommand.sendCommand('{"hold":1, "t_heat":' + "58" + ', "tmode":1}')

In this way you avoid the double command, and issues with the radiothermostat timing out when it's doing too much. Also, since people would migrate from the http binding, they are already sending json strings. And this also leaves open the possibility that somebody may want to do something with an undocumented api that we weren't aware of.

Signed-off-by: Michael Lobstein <[email protected]>
@mlobstein
Copy link
Contributor Author

@billfor I made your suggested changes. Try it out and let me know what you think.

@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@billfor
Copy link
Contributor

billfor commented Apr 21, 2020

@billfor I made your suggested changes. Try it out and let me know what you think.

Looks good! Thank you.
If you want you could change it to Number:Time and then it will appear with the standard unit without the user having to do anything.

		<item-type>Number:Time</item-type>
		<state readOnly="true" pattern="%d %unit%"/>

Signed-off-by: Michael Lobstein <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@cpmeister cpmeister added the cre Coordinated Review Effort label May 30, 2020
@cpmeister
Copy link
Contributor

While waiting for the next reviewer. Please try to resolve all of these build warnings. Most of them can be resolved by caching fields in local variables and performing your logic on those local variables instead. If there are any you have trouble with let me know and I'll tell you how to solve it.

[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[105,4607] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[106,4633] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[109,4792] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[110,4816] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[113,5012] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[120,5393] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[120,5415] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[136,5869] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[139,6033] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[142,6126] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[142,6152] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[142,6159] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[151,6507] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[154,6676] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[156,6798] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[159,6891] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[161,7017] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[165,7129] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[165,7158] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[165,7165] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[173,7455] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[175,7528] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[176,7568] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[179,7672] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[180,7715] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[186,7866] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[209,8826] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[210,8895] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[214,9121] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[215,9193] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[216,9266] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[218,9401] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[220,9525] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[225,9855] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[229,10007] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[230,10078] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[233,10200] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[234,10275] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[238,10483] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[239,10550] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[241,10701] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[242,10768] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[247,10951] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[249,11067] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[250,11152] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[252,11268] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[257,11504] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[360,15791] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[361,15904] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[373,16356] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[375,16442] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[377,16535] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[379,16626] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[380,16730] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[385,16919] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[387,17020] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[389,17110] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[391,17200] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[393,17286] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[393,17286] Potential null pointer access: The method getTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[395,17383] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[395,17383] Potential null pointer access: The method getTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[397,17477] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[397,17477] Potential null pointer access: The method getTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[399,17577] Potential null pointer access: The method getThermostatData() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[399,17577] Potential null pointer access: The method getTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[401,17715] Potential null pointer access: The method getRuntime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[401,17715] Potential null pointer access: The method getToday() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[401,17715] Potential null pointer access: The method getHeatTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[403,17870] Potential null pointer access: The method getRuntime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[403,17870] Potential null pointer access: The method getToday() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[403,17870] Potential null pointer access: The method getCoolTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[405,18029] Potential null pointer access: The method getRuntime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[405,18029] Potential null pointer access: The method getYesterday() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[405,18029] Potential null pointer access: The method getHeatTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[408,18216] Potential null pointer access: The method getRuntime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[408,18216] Potential null pointer access: The method getYesterday() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[408,18216] Potential null pointer access: The method getCoolTime() may return null
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/RadioThermostatThingActions.java:[42,1624] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/discovery/RadioThermostatDiscoveryService.java:[86,3376] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/discovery/RadioThermostatDiscoveryService.java:[87,3421] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/communication/RadioThermostatConnector.java:[89,3246] Potential null pointer access: this expression has a '@Nullable' type
[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/communication/RadioThermostatConnector.java:[143,5550] Null type mismatch: required '@NonNull String' but the provided value is inferred as @Nullable

@mlobstein
Copy link
Contributor Author

While waiting for the next reviewer. Please try to resolve all of these build warnings. Most of them can be resolved by caching fields in local variables and performing your logic on those local variables instead. If there are any you have trouble with let me know and I'll tell you how to solve it.

[WARNING] /home/travis/build/openhab/openhab-addons/bundles/org.openhab.binding.radiothermostat/src/main/java/org/openhab/binding/radiothermostat/internal/handler/RadioThermostatHandler.java:[105,4607] Potential null pointer access: this expression has a '@Nullable' type

I am not sure about those that all appear because of the NotNullByDefault annotation. In the DTO for example, the only way I see to fix it is to assign default values for everything.

@cpmeister
Copy link
Contributor

cpmeister commented May 30, 2020

We have null checker exclusions in place for DTO classes, if you want to have your DTO class excluded from null checks you must fulfill one of the two following criteria:

  1. Make sure that your class name ends in DTO
  2. Make sure that your class is in a package or subpackage called dto.

Signed-off-by: Michael Lobstein <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@mlobstein
Copy link
Contributor Author

While waiting for the next reviewer. Please try to resolve all of these build warnings. Most of them can be resolved by caching fields in local variables and performing your logic on those local variables instead. If there are any you have trouble with let me know and I'll tell you how to solve it.

Done!


This binding connects RadioThermostat/3M Filtrete models CT30, CT50/3M50, CT80, etc. with built-in Wi-Fi module to openHAB.

The binding retrieves and periodically updates all basic system information from the thermostat. The main thermostat functions such
Copy link
Member

Choose a reason for hiding this comment

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

Please add a line break after every sentence throughout the README, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

got it

<parent>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.addons.reactor.bundles</artifactId>
<version>2.5.6-SNAPSHOT</version>
Copy link
Member

Choose a reason for hiding this comment

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

As 2.5.6 has just been release, we have to ask you to change this version for a very last time, promised ;-)

Suggested change
<version>2.5.6-SNAPSHOT</version>
<version>2.5.7-SNAPSHOT</version>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done! Thanks @kaikreuzer

@TravisBuddy
Copy link

Travis tests were successful

Hey @mlobstein,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@mlobstein mlobstein requested a review from kaikreuzer June 24, 2020 19:37
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

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

Perfect, thank you!

@kaikreuzer kaikreuzer merged commit ef0d11c into openhab:2.5.x Jun 24, 2020
@kaikreuzer kaikreuzer removed the cre Coordinated Review Effort label Jun 24, 2020
@cpmeister cpmeister added this to the 2.5.7 milestone Jun 24, 2020
knikhilwiz pushed a commit to knikhilwiz/openhab2-addons that referenced this pull request Jul 12, 2020
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
@mlobstein mlobstein deleted the RadioThermostat branch August 1, 2020 20:46
MPH80 pushed a commit to MPH80/openhab-addons that referenced this pull request Aug 3, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new binding If someone has started to work on a binding. For a new binding PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants