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

@ -7,6 +7,6 @@
<feature>openhab-core-auth-oauth2client</feature>
<bundle dependency="true">mvn:org.jsoup/jsoup/1.14.3</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.linky/${project.version}</bundle>
</feature>
</features>

View File

@ -199,4 +199,4 @@ public class LinkyAuthService {
protected void unsetHttpService(HttpService httpService) {
this.httpService = null;
}
}
}

View File

@ -169,4 +169,4 @@ public class LinkyAuthServlet extends HttpServlet {
m.appendTail(sb);
return sb.toString();
}
}
}

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_AUTHORIZE_URL = ENEDIS_ACCOUNT_URL + "dataconnect/v1/oauth2/authorize";
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,
true);
this.authService.setLinkyAccountHandler(this);
}
@Override
@ -181,7 +180,6 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
return accessTokenResponse != null && accessTokenResponse.getAccessToken() != null
&& accessTokenResponse.getRefreshToken() != null;
}
private @Nullable AccessTokenResponse getAccessTokenResponse() {
@ -288,7 +286,6 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
uri = uri + "&response_type=" + "code";
return uri;
}
}
@Override
@ -308,5 +305,4 @@ public class LinkyHandlerFactory extends BaseThingHandlerFactory implements Link
return result.toArray(new String[0]);
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,31 +12,32 @@
https://espace-client-particuliers.enedis.fr/web/espace-particuliers/compteur-linky.
</description>
<channel-groups>
<channel-group typeId="main" id="main"/>
<channel-group typeId="main" id="main"/>
<channel-group typeId="daily" id="daily"/>
<channel-group typeId="weekly" id="weekly"/>
<channel-group typeId="monthly" id="monthly"/>
<channel-group typeId="yearly" id="yearly"/>
</channel-groups>
<config-description>
<parameter name="prmId" type="text" required="true">
<label>PrmId</label>
<description>Your PrmId</description>
</parameter>
<parameter name="prmId" type="text" required="true">
<label>PrmId</label>
<description>Your PrmId</description>
</parameter>
<parameter name="token" type="text" required="false">
<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>
</config-description>
</thing-type>
<channel-group-type id="daily">
@ -46,26 +47,26 @@
<label>Yesterday Consumption</label>
</channel>
<channel id="day-2" typeId="consumption">
<label>Yesterday Consumption</label>
</channel>
<channel id="day-3" typeId="consumption">
<label>Yesterday Consumption</label>
</channel>
<label>Yesterday Consumption</label>
</channel>
<channel id="day-3" typeId="consumption">
<label>Yesterday Consumption</label>
</channel>
<channel id="maxPower-day-1" typeId="power"/>
<channel id="maxPowerTs-day-1" typeId="timestamp">
<label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description>
</channel>
<channel id="maxPower-day-2" typeId="power"/>
<channel id="maxPowerTs-day-2" typeId="timestamp">
<label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description>
</channel>
<channel id="maxPower-day-3" typeId="power"/>
<channel id="maxPowerTs-day-3" typeId="timestamp">
<label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description>
</channel>
<channel id="maxPower-day-2" typeId="power"/>
<channel id="maxPowerTs-day-2" typeId="timestamp">
<label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description>
</channel>
<channel id="maxPower-day-3" typeId="power"/>
<channel id="maxPowerTs-day-3" typeId="timestamp">
<label>Peak Timestamp</label>
<description>Maximum power usage timestamp</description>
</channel>
</channels>
</channel-group-type>
@ -79,8 +80,8 @@
<label>Last Week Consumption</label>
</channel>
<channel id="week-2" typeId="consumption">
<label>Last Week Consumption</label>
</channel>
<label>Last Week Consumption</label>
</channel>
</channels>
</channel-group-type>
@ -93,9 +94,9 @@
<channel id="month-1" typeId="consumption">
<label>Last Month Consumption</label>
</channel>
<channel id="month-2" typeId="consumption">
<label>Last Month Consumption</label>
</channel>
<channel id="month-2" typeId="consumption">
<label>Last Month Consumption</label>
</channel>
</channels>
</channel-group-type>
@ -108,27 +109,27 @@
<channel id="year-1" typeId="consumption">
<label>Last Year Consumption</label>
</channel>
<channel id="year-2" typeId="consumption">
<label>Last Year Consumption</label>
</channel>
<channel id="year-2" typeId="consumption">
<label>Last Year Consumption</label>
</channel>
</channels>
</channel-group-type>
<channel-group-type id="main">
<label>Main</label>
<channels>
<channel id="linkyTestSelect" typeId="typeTest">
<label>linkyTestSelect</label>
</channel>
</channels>
</channel-group-type>
<label>Main</label>
<channels>
<channel id="linkyTestSelect" typeId="typeTest">
<label>linkyTestSelect</label>
</channel>
</channels>
</channel-group-type>
<channel-type id="typeTest">
<item-type>String</item-type>
<label>Test Select</label>
<description>Test Select</description>
</channel-type>
<item-type>String</item-type>
<label>Test Select</label>
<description>Test Select</description>
</channel-type>
<channel-type id="consumption">
<item-type>Number:Energy</item-type>