/*
 * Copyright (c) 2010-2026 Contributors to the openHAB project
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 */
package org.openhab.binding.mqtt.ruuvigateway.internal;

import static org.openhab.binding.mqtt.MqttBindingConstants.BINDING_ID;

import java.util.Set;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;

/**
 * The {@link RuuviGatewayBindingConstants} class defines common constants, which are
 * used across the whole binding.
 *
 * @author Matthew Skinner - Initial contribution
 */
@NonNullByDefault
public class RuuviGatewayBindingConstants {
    public static final String BASE_TOPIC = "ruuvi/";

    // List of all Thing Type UIDs
    public static final ThingTypeUID THING_TYPE_BEACON = new ThingTypeUID(BINDING_ID, "ruuvitag_beacon");

    // Channel IDs - Environmental measurements (RuuviTag)
    public static final String CHANNEL_ID_BATTERY = "batteryVoltage";
    public static final String CHANNEL_ID_DATA_FORMAT = "dataFormat";
    public static final String CHANNEL_ID_TEMPERATURE = "temperature";
    public static final String CHANNEL_ID_HUMIDITY = "humidity";
    public static final String CHANNEL_ID_PRESSURE = "pressure";
    public static final String CHANNEL_ID_TX_POWER = "txPower";
    public static final String CHANNEL_ID_ACCELERATIONX = "accelerationx";
    public static final String CHANNEL_ID_ACCELERATIONY = "accelerationy";
    public static final String CHANNEL_ID_ACCELERATIONZ = "accelerationz";
    public static final String CHANNEL_ID_MEASUREMENT_SEQUENCE_NUMBER = "measurementSequenceNumber";
    public static final String CHANNEL_ID_MOVEMENT_COUNTER = "movementCounter";

    // Channel IDs - Air Quality measurements (Ruuvi Air Format 6+)
    public static final String CHANNEL_ID_PM1 = "pm1";
    public static final String CHANNEL_ID_PM25 = "pm25";
    public static final String CHANNEL_ID_PM4 = "pm4";
    public static final String CHANNEL_ID_PM10 = "pm10";
    public static final String CHANNEL_ID_CO2 = "co2";
    public static final String CHANNEL_ID_VOC_INDEX = "vocIndex";
    public static final String CHANNEL_ID_NOX_INDEX = "noxIndex";
    public static final String CHANNEL_ID_LUMINOSITY = "luminosity";
    public static final String CHANNEL_ID_CALIBRATION_COMPLETED = "calibrationCompleted";
    public static final String CHANNEL_ID_AIR_QUALITY_INDEX = "airQualityIndex";

    // Channel IDs - Gateway metadata
    public static final String CHANNEL_ID_RSSI = "rssi";
    public static final String CHANNEL_ID_TS = "ts";
    public static final String CHANNEL_ID_GWTS = "gwts";
    public static final String CHANNEL_ID_GWMAC = "gwmac";

    public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_BEACON);
    public static final int RUUVI_GATEWAY_SUBSCRIBE_TIMEOUT_MS = 30000;

    // Thing properties
    public static final String PROPERTY_TAG_ID = "tagID";
    public static final String CONFIGURATION_PROPERTY_TOPIC = "topic";

    public static final String CONFIGURATION_PROPERTY_TIMEOUT = "timeout"; // only for tests
}
