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.monopriceaudio.internal.dto;
16 * Represents the data elements of a single zone of the Monoprice Whole House Amplifier
18 * @author Michael Lobstein - Initial contribution
20 public class MonopriceAudioZoneDTO {
31 private String source;
32 private String keypad;
34 public void setZone(String zone) {
38 public void setPage(String page) {
42 public String getPage() {
46 public boolean isPageActive() {
47 return ("01").equals(this.page);
50 public void setPower(String power) {
54 public String getPower() {
58 public boolean isPowerOn() {
59 return ("01").equals(this.power);
62 public void setMute(String mute) {
66 public String getMute() {
70 public boolean isMuted() {
71 return ("01").equals(this.mute);
74 public void setDnd(String dnd) {
78 public String getDnd() {
82 public boolean isDndOn() {
83 return ("01").equals(this.dnd);
86 public int getVolume() {
90 public void setVolume(int volume) {
94 public int getTreble() {
98 public void setTreble(int treble) {
102 public int getBass() {
106 public void setBass(int bass) {
110 public int getBalance() {
114 public void setBalance(int balance) {
115 this.balance = balance;
118 public String getSource() {
122 public void setSource(String source) {
123 this.source = source;
126 public void setKeypad(String keypad) {
127 this.keypad = keypad;
130 public String getKeypad() {
134 public boolean isKeypadActive() {
135 return ("01").equals(this.keypad);
139 public String toString() {
140 // Re-construct the original status message from the controller
141 // This is used to determine if something changed from the last polling update
142 return zone + page + power + mute + dnd + (String.format("%02d", volume)) + (String.format("%02d", treble))
143 + (String.format("%02d", bass)) + (String.format("%02d", balance)) + source + keypad;