Java 17 features (A-G) (#15516)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -296,13 +296,11 @@ public class EvohomeAccountBridgeHandler extends BaseBridgeHandler {
|
||||
for (Thing handler : getThing().getThings()) {
|
||||
ThingHandler thingHandler = handler.getHandler();
|
||||
|
||||
if (thingHandler instanceof EvohomeTemperatureControlSystemHandler) {
|
||||
EvohomeTemperatureControlSystemHandler tcsHandler = (EvohomeTemperatureControlSystemHandler) thingHandler;
|
||||
if (thingHandler instanceof EvohomeTemperatureControlSystemHandler tcsHandler) {
|
||||
tcsHandler.update(tcsIdToGatewayMap.get(tcsHandler.getId()), idToTcsMap.get(tcsHandler.getId()));
|
||||
idToTcsThingsStatusMap.put(tcsHandler.getId(), tcsHandler.getThing().getStatus());
|
||||
}
|
||||
if (thingHandler instanceof EvohomeHeatingZoneHandler) {
|
||||
EvohomeHeatingZoneHandler zoneHandler = (EvohomeHeatingZoneHandler) thingHandler;
|
||||
if (thingHandler instanceof EvohomeHeatingZoneHandler zoneHandler) {
|
||||
zoneHandler.update(idToTcsThingsStatusMap.get(zoneIdToTcsIdMap.get(zoneHandler.getId())),
|
||||
idToZoneMap.get(zoneHandler.getId()));
|
||||
}
|
||||
|
||||
@@ -86,8 +86,8 @@ public class EvohomeHeatingZoneHandler extends BaseEvohomeHandler {
|
||||
if (bridge != null) {
|
||||
String channelId = channelUID.getId();
|
||||
if (EvohomeBindingConstants.ZONE_SET_POINT_CHANNEL.equals(channelId)) {
|
||||
if (command instanceof QuantityType) {
|
||||
QuantityType<?> state = ((QuantityType<?>) command).toUnit(SIUnits.CELSIUS);
|
||||
if (command instanceof QuantityType quantityCommand) {
|
||||
QuantityType<?> state = quantityCommand.toUnit(SIUnits.CELSIUS);
|
||||
double newTempInCelsius = state.doubleValue();
|
||||
|
||||
if (newTempInCelsius == CANCEL_SET_POINT_OVERRIDE) {
|
||||
|
||||
Reference in New Issue
Block a user