1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-12-28 11:35:48 +01:00

Huawei: Fix some linter warnings

This commit is contained in:
Martin.JM 2024-11-24 11:28:22 +01:00
parent c5a5cd1649
commit 78d6ad3a1f

View File

@ -16,6 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>. */ along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets; package nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets;
import androidx.annotation.NonNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -401,9 +403,9 @@ public class Weather {
if (windDirection != null) { if (windDirection != null) {
if (windDirection > 0) if (windDirection > 0)
wind |= ((short) (windDirection * 8 / 360)) << 8; wind |= (short) (((short) (windDirection * 8 / 360)) << 8);
else else
wind |= ((short) (360 + windDirection) * 8 / 360) << 8; wind |= (short) (((short) (360 + windDirection) * 8 / 360) << 8);
} }
tlv81.put(0x03, wind); tlv81.put(0x03, wind);
} }
@ -585,6 +587,7 @@ public class Weather {
public WeatherIcon icon; public WeatherIcon icon;
public Byte temperature; public Byte temperature;
@NonNull
@Override @Override
public String toString() { public String toString() {
String timestampStr = new Date(timestamp * 1000L).toString(); String timestampStr = new Date(timestamp * 1000L).toString();
@ -608,6 +611,7 @@ public class Weather {
public Integer moonSetTime; public Integer moonSetTime;
public MoonPhase moonPhase; public MoonPhase moonPhase;
@NonNull
@Override @Override
public String toString() { public String toString() {
String timestampStr = new Date(timestamp * 1000L).toString(); String timestampStr = new Date(timestamp * 1000L).toString();