spotless:apply

Signed-off-by: Laurent ARNAL <laurent@clae.net>
This commit is contained in:
Laurent ARNAL 2024-02-01 19:31:05 +01:00
parent 6e40ddfcf4
commit 6f8b6a621a
12 changed files with 57 additions and 72 deletions

View File

@ -81,5 +81,4 @@ public class LinkyBindingConstants {
public static final String ENEDIS_ACCOUNT_URL = "https://mon-compte-particulier.enedis.fr/"; public static final String ENEDIS_ACCOUNT_URL = "https://mon-compte-particulier.enedis.fr/";
public static final String ENEDIS_AUTHORIZE_URL = ENEDIS_ACCOUNT_URL + "dataconnect/v1/oauth2/authorize"; public static final String ENEDIS_AUTHORIZE_URL = ENEDIS_ACCOUNT_URL + "dataconnect/v1/oauth2/authorize";
public static final String ENEDIS_API_TOKEN_URL = ENEDIS_ACCOUNT_URL + "token"; public static final String ENEDIS_API_TOKEN_URL = ENEDIS_ACCOUNT_URL + "token";
} }

View File

@ -134,7 +134,6 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
LinkyBindingConstants.LINKY_AUTHORIZE_URL, clientId, clientSecret, LinkyBindingConstants.LINKY_SCOPES, LinkyBindingConstants.LINKY_AUTHORIZE_URL, clientId, clientSecret, LinkyBindingConstants.LINKY_SCOPES,
true); true);
this.authService.setLinkyAccountHandler(this); this.authService.setLinkyAccountHandler(this);
} }
@Override @Override
@ -181,7 +180,6 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
return accessTokenResponse != null && accessTokenResponse.getAccessToken() != null return accessTokenResponse != null && accessTokenResponse.getAccessToken() != null
&& accessTokenResponse.getRefreshToken() != null; && accessTokenResponse.getRefreshToken() != null;
} }
private @Nullable AccessTokenResponse getAccessTokenResponse() { private @Nullable AccessTokenResponse getAccessTokenResponse() {
@ -288,7 +286,6 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
uri = uri + "&response_type=" + "code"; uri = uri + "&response_type=" + "code";
return uri; return uri;
} }
} }
@Override @Override
@ -308,5 +305,4 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
return result.toArray(new String[0]); return result.toArray(new String[0]);
} }
} }

View File

@ -35,5 +35,4 @@ public class AddressInfo {
public String city; public String city;
public String country; public String country;
} }

View File

@ -29,5 +29,4 @@ public class Customer {
@SerializedName("usage_points") @SerializedName("usage_points")
public UsagePoint[] usagePoints; public UsagePoint[] usagePoints;
} }

View File

@ -31,5 +31,4 @@ public class IntervalReading {
@SerializedName("date") @SerializedName("date")
public LocalDateTime date; public LocalDateTime date;
} }

View File

@ -45,5 +45,4 @@ public class MeterReading {
public IntervalReading[] weekValue; public IntervalReading[] weekValue;
public IntervalReading[] monthValue; public IntervalReading[] monthValue;
public IntervalReading[] yearValue; public IntervalReading[] yearValue;
} }

View File

@ -26,5 +26,4 @@ import com.google.gson.annotations.SerializedName;
public class MeterResponse { public class MeterResponse {
@SerializedName("meter_reading") @SerializedName("meter_reading")
public MeterReading meterReading; public MeterReading meterReading;
} }

View File

@ -39,11 +39,7 @@ import org.openhab.core.auth.client.oauth2.OAuthFactory;
import org.openhab.core.config.core.Configuration; import org.openhab.core.config.core.Configuration;
import org.openhab.core.i18n.LocaleProvider; import org.openhab.core.i18n.LocaleProvider;
import org.openhab.core.library.types.QuantityType; import org.openhab.core.library.types.QuantityType;
<<<<<<< HEAD
import org.openhab.core.library.unit.MetricPrefix;
=======
import org.openhab.core.library.types.StringType; import org.openhab.core.library.types.StringType;
>>>>>>> 8179e0592f (some fixes on connectlinky page)
import org.openhab.core.library.unit.Units; import org.openhab.core.library.unit.Units;
import org.openhab.core.thing.ChannelUID; import org.openhab.core.thing.ChannelUID;
import org.openhab.core.thing.Thing; import org.openhab.core.thing.Thing;
@ -594,10 +590,9 @@ public class LinkyHandler extends BaseThingHandler {
if (meterReading.intervalReading.length == 0) { if (meterReading.intervalReading.length == 0) {
throw new LinkyException("Invalid meterReading data: no day period"); throw new LinkyException("Invalid meterReading data: no day period");
} }
if (meterReading.intervalReading.length != 1095) { // if (meterReading.intervalReading.length != 1095) {
throw new LinkyException("Imcomplete meterReading data < 1095 days"); // throw new LinkyException("Imcomplete meterReading data < 1095 days");
} // }
} }
/* /*
@ -687,5 +682,4 @@ public class LinkyHandler extends BaseThingHandler {
public void saveConfiguration(Configuration config) { public void saveConfiguration(Configuration config) {
updateConfiguration(config); updateConfiguration(config);
} }
} }

View File

@ -14,7 +14,7 @@
<channel-groups> <channel-groups>
<channel-group typeId="main" id="main"/> <channel-group typeId="main" id="main"/>
<channel-group typeId="daily" id="daily"/> <channel-group typeId="daily" id="daily"/>
<channel-group typeId="weekly" id="weekly"/> <channel-group typeId="weekly" id="weekly"/>
<channel-group typeId="monthly" id="monthly"/> <channel-group typeId="monthly" id="monthly"/>
@ -26,13 +26,14 @@
<config-description> <config-description>
<parameter name="prmId" type="text" required="true"> <parameter name="prmId" type="text" required="true">
<label>PrmId</label> <label>PrmId</label>
<description>Your PrmId</description> <description>Your PrmId</description>
</parameter> </parameter>
<parameter name="token" type="text" required="false"> <parameter name="token" type="text" required="false">
<label>Token</label> <label>Token</label>
<description>Your Enedis token (can be left empty, use the connection page to automatically fill it http://youopenhab/connectlinky)</description> <description>Your Enedis token (can be left empty, use the connection page to automatically fill it
http://youopenhab/connectlinky)</description>
</parameter> </parameter>
</config-description> </config-description>
@ -46,26 +47,26 @@
<label>Yesterday Consumption</label> <label>Yesterday Consumption</label>
</channel> </channel>
<channel id="day-2" typeId="consumption"> <channel id="day-2" typeId="consumption">
<label>Yesterday Consumption</label> <label>Yesterday Consumption</label>
</channel> </channel>
<channel id="day-3" typeId="consumption"> <channel id="day-3" typeId="consumption">
<label>Yesterday Consumption</label> <label>Yesterday Consumption</label>
</channel> </channel>
<channel id="maxPower-day-1" typeId="power"/> <channel id="maxPower-day-1" typeId="power"/>
<channel id="maxPowerTs-day-1" typeId="timestamp"> <channel id="maxPowerTs-day-1" typeId="timestamp">
<label>Peak Timestamp</label> <label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description> <description>Maximum power usage timestamp</description>
</channel> </channel>
<channel id="maxPower-day-2" typeId="power"/> <channel id="maxPower-day-2" typeId="power"/>
<channel id="maxPowerTs-day-2" typeId="timestamp"> <channel id="maxPowerTs-day-2" typeId="timestamp">
<label>Peak Timestamp</label> <label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description> <description>Maximum power usage timestamp</description>
</channel> </channel>
<channel id="maxPower-day-3" typeId="power"/> <channel id="maxPower-day-3" typeId="power"/>
<channel id="maxPowerTs-day-3" typeId="timestamp"> <channel id="maxPowerTs-day-3" typeId="timestamp">
<label>Peak Timestamp</label> <label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description> <description>Maximum power usage timestamp</description>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>
@ -79,8 +80,8 @@
<label>Last Week Consumption</label> <label>Last Week Consumption</label>
</channel> </channel>
<channel id="week-2" typeId="consumption"> <channel id="week-2" typeId="consumption">
<label>Last Week Consumption</label> <label>Last Week Consumption</label>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>
@ -93,9 +94,9 @@
<channel id="month-1" typeId="consumption"> <channel id="month-1" typeId="consumption">
<label>Last Month Consumption</label> <label>Last Month Consumption</label>
</channel> </channel>
<channel id="month-2" typeId="consumption"> <channel id="month-2" typeId="consumption">
<label>Last Month Consumption</label> <label>Last Month Consumption</label>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>
@ -108,27 +109,27 @@
<channel id="year-1" typeId="consumption"> <channel id="year-1" typeId="consumption">
<label>Last Year Consumption</label> <label>Last Year Consumption</label>
</channel> </channel>
<channel id="year-2" typeId="consumption"> <channel id="year-2" typeId="consumption">
<label>Last Year Consumption</label> <label>Last Year Consumption</label>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>
<channel-group-type id="main"> <channel-group-type id="main">
<label>Main</label> <label>Main</label>
<channels> <channels>
<channel id="linkyTestSelect" typeId="typeTest"> <channel id="linkyTestSelect" typeId="typeTest">
<label>linkyTestSelect</label> <label>linkyTestSelect</label>
</channel> </channel>
</channels> </channels>
</channel-group-type> </channel-group-type>
<channel-type id="typeTest"> <channel-type id="typeTest">
<item-type>String</item-type> <item-type>String</item-type>
<label>Test Select</label> <label>Test Select</label>
<description>Test Select</description> <description>Test Select</description>
</channel-type> </channel-type>
<channel-type id="consumption"> <channel-type id="consumption">
<item-type>Number:Energy</item-type> <item-type>Number:Energy</item-type>