]> git.basschouten.com Git - openhab-addons.git/blob
a1c2c300bcce4f86000ffd9877508c57b693251e
[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.lgtvserial.internal.protocol.serial.commands;
14
15 import org.openhab.binding.lgtvserial.internal.protocol.serial.LGSerialResponse;
16 import org.openhab.binding.lgtvserial.internal.protocol.serial.responses.QuantityResponse;
17 import org.openhab.core.library.types.QuantityType;
18 import org.openhab.core.library.unit.SIUnits;
19
20 /**
21  * This class handles the temperature value D/N command.
22  *
23  * @author Richard Lavoie - Initial contribution
24  *
25  */
26 public class TemperatureValueCommand extends BaseDecimalCommand {
27
28     protected TemperatureValueCommand(int setId) {
29         super('d', 'n', setId, false);
30     }
31
32     @Override
33     protected LGSerialResponse createResponse(int set, boolean success, String data) {
34         return new QuantityResponse(set, success, new QuantityType<>(Integer.parseInt(data, 16), SIUnits.CELSIUS));
35     }
36 }