]> git.basschouten.com Git - openhab-addons.git/blob
70cf0b45df7d9166f398460554312fb6de66253a
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.energidataservice.internal.config;
14
15 import java.util.Currency;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.energidataservice.internal.EnergiDataServiceBindingConstants;
19 import org.openhab.binding.energidataservice.internal.api.GlobalLocationNumber;
20
21 /**
22  * The {@link EnergiDataServiceConfiguration} class contains fields mapping thing configuration parameters.
23  *
24  * @author Jacob Laursen - Initial contribution
25  */
26 @NonNullByDefault
27 public class EnergiDataServiceConfiguration {
28
29     /**
30      * Price area (DK1 = West of the Great Belt, DK2 = East of the Great Belt).
31      */
32     public String priceArea = "";
33
34     /**
35      * Currency code for the prices.
36      */
37     public String currencyCode = EnergiDataServiceBindingConstants.CURRENCY_DKK.getCurrencyCode();
38
39     /**
40      * Global Location Number of the Grid Company.
41      */
42     public String gridCompanyGLN = "";
43
44     /**
45      * Global Location Number of Energinet.
46      */
47     public String energinetGLN = "5790000432752";
48
49     /**
50      * Get {@link Currency} representing the configured currency code.
51      * 
52      * @return Currency instance
53      */
54     public Currency getCurrency() {
55         return Currency.getInstance(currencyCode);
56     }
57
58     public GlobalLocationNumber getGridCompanyGLN() {
59         return GlobalLocationNumber.of(gridCompanyGLN);
60     }
61
62     public GlobalLocationNumber getEnerginetGLN() {
63         return GlobalLocationNumber.of(energinetGLN);
64     }
65 }