fixes for Jacob review

Signed-off-by: Laurent ARNAL <laurent@clae.net>
This commit is contained in:
Laurent ARNAL 2025-01-08 12:20:01 +01:00
parent 592907a4bf
commit 40202b1641
3 changed files with 8 additions and 6 deletions

View File

@ -161,12 +161,12 @@ public class LinkyHandler extends BaseThingHandler {
// update the timezone if not set to default to openhab default timezone
Configuration thingConfig = getConfig();
Object val = thingConfig.get("timezone");
if (val == null || "".equals(val)) {
String val = (String) thingConfig.get("timezone");
if (val == null || val.isBlank()) {
zoneId = this.timeZoneProvider.getTimeZone();
thingConfig.put("timezone", zoneId.getId());
} else {
zoneId = ZoneId.of((String) val);
zoneId = ZoneId.of(val);
}
updateConfiguration(thingConfig);

View File

@ -14,6 +14,8 @@ thing-type.config.linky.linky.internalAuthId.label = Auth ID
thing-type.config.linky.linky.internalAuthId.description = Authentication ID delivered after the captcha (see documentation).
thing-type.config.linky.linky.password.label = Password
thing-type.config.linky.linky.password.description = Your Enedis Password
thing-type.config.linky.linky.timezone.label = timezone
thing-type.config.linky.linky.timezone.description = The timezone associated with your Point of delivery. Will default to openHAB default timezone. You will need to change this if your Linky is located in a different timezone that your openHAB location. You can use an offset, or a label like Europe/Paris
thing-type.config.linky.linky.username.label = Username
thing-type.config.linky.linky.username.description = Your Enedis Username
@ -41,6 +43,6 @@ channel-type.linky.power.label = Yesterday Peak Power
channel-type.linky.power.description = Maximum power usage yesterday
channel-type.linky.timestamp.label = Timestamp
# Thing status descriptions
# thing status descriptions
offline.config-error-mandatory-settings = Username, password and authId are mandatory.

View File

@ -37,9 +37,9 @@
<parameter name="timezone" type="text" required="false">
<label>timezone</label>
<description>The timezone associated with your Point of delivery.
Will default to openhab default timezone.
Will default to openHAB default timezone.
You will
need to change this if your linky is located in a different timezone that your openhab location.
need to change this if your Linky is located in a different timezone that your openHAB location.
You can use an
offset, or a label like Europe/Paris</description>
</parameter>