2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.plugwise.internal.protocol.field;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * The power calibration data of a relay device (Circle, Circle+, Stealth). It is used in {@link Energy} to calculate
19 * energy (kWh) and power (W) from pulses.
21 * @author Wouter Born - Initial contribution
24 public class PowerCalibration {
26 private final double gainA;
27 private final double gainB;
28 private final double offsetTotal;
29 private final double offsetNoise;
31 public PowerCalibration(double gainA, double gainB, double offsetNoise, double offsetTotal) {
34 this.offsetNoise = offsetNoise;
35 this.offsetTotal = offsetTotal;
38 public double getGainA() {
42 public double getGainB() {
46 public double getOffsetTotal() {
50 public double getOffsetNoise() {
55 public String toString() {
56 return "PowerCalibration [gainA=" + gainA + ", gainB=" + gainB + ", offsetTotal=" + offsetTotal
57 + ", offsetNoise=" + offsetNoise + "]";