2 * Copyright (c) 2010-2024 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.pentair.internal;
16 * Pentair heat set point packet specialization of a PentairPacket. Includes public variables for many of the reverse
20 * @author Jeff James - initial contribution
23 public class PentairPacketHeatSetPoint extends PentairPacket {
25 protected static final int POOLTEMP = 5 + OFFSET;
26 protected static final int AIRTEMP = 6 + OFFSET;
27 protected static final int POOLSETPOINT = 7 + OFFSET;
28 protected static final int SPASETPOINT = 8 + OFFSET;
29 protected static final int HEATMODE = 9 + OFFSET;
30 protected static final int SOLARTEMP = 12 + OFFSET;
32 protected final String[] heatmodestrs = { "Off", "Heater", "Solar Pref", "Solar" };
34 /** pool temperature set point */
35 public int poolsetpoint;
36 /** pool heat mode - 0=Off, 1=Heater, 2=Solar Pref, 3=Solar */
37 public int poolheatmode;
38 /** pool heat mode as a string */
39 public String poolheatmodestr;
40 /** spa temperature set point */
41 public int spasetpoint;
42 /** spa heat mode - 0=Off, 1=Heater, 2=Solar Pref, 3=Solar */
43 public int spaheatmode;
44 /** spa heat mode as a string */
45 public String spaheatmodestr;
48 * Constructor to create a specialized packet representing the generic packet. Note, the internal buffer array is
50 * duplicated. Fills in public class members appropriate with the correct values.
52 * @param p Generic PentairPacket to create specific Status packet
54 public PentairPacketHeatSetPoint(PentairPacket p) {
57 poolsetpoint = p.buf[POOLSETPOINT];
58 poolheatmode = p.buf[HEATMODE] & 0x03;
59 poolheatmodestr = heatmodestrs[poolheatmode];
61 spasetpoint = p.buf[SPASETPOINT];
62 spaheatmode = (p.buf[HEATMODE] >> 2) & 0x03;
63 spaheatmodestr = heatmodestrs[spaheatmode];
67 * Constructure to create an empty status packet
69 public PentairPacketHeatSetPoint() {