Presetclass storing the user's antifreeze setpoint. In this class, we should provide two utilities to disable the antifreeze check and to find out whether the feature is enabled or not.
Handle the antifreeze feature in the
Overviewactivity, updating the user interface when a setpoint is selected.
Update the boiler logic in the
SensorThreadclass so it takes into account the antifreeze check when it's enabled.
We begin our work by changing the
Preset class with the following steps:
At the top of the class, add the highlighted declarations:
private static final String CURRENT_LOCATION = "__LOCATION__"; private static final String CURRENT_ANTIFREEZE = "__ANTIFREEZE__"; private static final float ANTIFREEZE_DISABLED = -Float.MAX_VALUE
We use the