-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to get the current tank's compressor status and fil…
…l level (#31)
- Loading branch information
1 parent
d720333
commit 047a359
Showing
6 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.bigboxer23.eco_net.data; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
|
||
/** */ | ||
public class TankStatus { | ||
private static final String EMPTY = "ic_tank_zero_percent_v2.png.png"; | ||
private static final String ONE_THIRD = "ic_tank_ten_percent_v2.png"; | ||
private static final String TWO_THIRD = "ic_tank_fourty_percent_v2.png"; | ||
private static final String FULL = "ic_tank_hundread_percent_v2.png"; | ||
|
||
public static float getTankStatus(String tankStatusUrl) { | ||
return switch (StringUtils.defaultIfEmpty(tankStatusUrl, "")) { | ||
case EMPTY -> 0.0f; | ||
case ONE_THIRD -> .33f; | ||
case TWO_THIRD -> .66f; | ||
case FULL -> 1f; | ||
default -> -1f; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters