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.novafinedust.internal.sds011protocol.messages;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
18 * Data from the sensor containing information about the installed firmware
20 * @author Stefan Triller - Initial contribution
24 public class SensorFirmwareReply extends SensorReply {
26 private final byte year;
27 private final byte month;
28 private final byte day;
30 public SensorFirmwareReply(byte[] receivedData) {
32 this.year = receivedData[3];
33 this.month = receivedData[4];
34 this.day = receivedData[5];
38 * Gets the firmware of the sensor as a String
40 * @return firmware of the sensor formatted as YY-MM-DD
42 public String getFirmware() {
43 return year + "-" + month + "-" + day;
47 public String toString() {
48 return "FirmwareReply: [firmware=" + getFirmware() + "]";