from enum import Enum

class ModbusSensorModel(Enum):
    Albedo = "Albedo"
    SP = "SP"
    SQ = "SQ"
    S2 = "S2"
    SI = "SI"
    SN = "SN"
    SM = "SM"

Sensor_Registers = {
    ModbusSensorModel.Albedo : {
        "calibrated_output_incident": 0,
        "calibrated_output_reflected": 2,
        "incident_detector_mv": 4,
        "reflected_detector_mv": 6,
        "albedo": 8,
        "device_status": 12,
        "firmware_version": 14,
        "address": 20,
        "model": 22,
        "serial": 24,
        "baudrate": 26,
        "parity": 28,
        "stopbits": 30,
        "multiplier_incident": 32,
        "offset_incident": 34,
        "multiplier_reflected": 36,
        "offset_reflected": 38,
        "running_average": 40,
        "heater_status": 42
    },
    ModbusSensorModel.SP : {
        "calibrated_output": 0,
        "detector_mv": 2,
        "device_status": 6,
        "firmware_version": 8,
        "address": 16,
        "model": 18,
        "serial": 20,
        "baudrate": 22,
        "parity": 24,
        "stopbits": 26,
        "multiplier": 28,
        "offset": 30,
        "running_average": 32,
        "heater_status": 34
    },
    ModbusSensorModel.SQ : {
        "calibrated_output": 0,
        "detector_mv": 2,
        "immersed_output": 4,
        "device_status": 10,
        "firmware_version": 12,
        "address": 16,
        "model": 18,
        "serial": 20,
        "baudrate": 22,
        "parity": 24,
        "stopbits": 26,
        "multiplier": 28,
        "offset": 30,
        "immersion_factor": 32,
        "running_average": 36,
        "heater_status": 38
    },
    ModbusSensorModel.S2 : {
        "calibrated_output_PAR": 0,
        "calibrated_output_FAR": 2,
        "detector_mv_PAR": 4,
        "detector_mv_FAR": 6,
        "ratio": 8,
        "percentage_FAR": 10,
        "device_status": 14,
        "firmware_version": 16,
        "address": 20,
        "model": 22,
        "serial": 24,
        "baudrate": 26,
        "parity": 28,
        "stopbits": 30,
        "multiplier_PAR": 32,
        "offset_PAR": 34,
        "multiplier_FAR": 36,
        "offset_FAR": 38,
        "running_average": 40,
        "heater_status": 42
    },
    ModbusSensorModel.SI : {
        "target_temp": 0,
        "sensor_temp": 2,
        "detector_mv": 4,
        "thermistor_mv": 6,
        "device_status": 10,
        "firmware_version": 12,
        "address": 20,
        "model": 22,
        "serial": 24,
        "baudrate": 26,
        "parity": 28,
        "stopbits": 30,
        "mc0": 32,
        "mc1": 34,
        "mc2": 36,
        "bc0": 38,
        "bc1": 40,
        "bc2": 42,
        "running_average": 44
    },
    ModbusSensorModel.SN : {
        "calibrated_shortwave_up": 0,
        "calibrated_shortwave_down": 2,
        "calibrated_longwave_up": 4,
        "calibrated_longwave_down": 6,
        "shortwave_net": 8,
        "longwave_net": 10,
        "total_net": 12,
        "albedo": 14,
        "shortwave_up_mv": 16,
        "shortwave_down_mv": 18,
        "longwave_up_mv": 20,
        "longwave_down_mv": 22,
        "longwave_up_temp": 24,
        "longwave_down_temp": 26,
        "device_status": 30,
        "firmware_version": 12,
        "address": 40,
        "model": 42,
        "serial": 44,
        "baudrate": 46,
        "parity": 48,
        "stopbits": 50,
        "longwave_up_multiplier": 52,
        "longwave_up_offset": 54,
        "longwave_down_multiplier": 56,
        "longwave_down_offset": 58,
        "shortwave_up_multiplier": 60,
        "shortwave_down_multiplier": 62,
        "running_average": 64,
        "heater_status": 66
    },
    ModbusSensorModel.SM : {
        "PAR": 0,
        "temp": 2,
        "humidity": 4,
        "co2": 6,
        "pressure": 8,
        "vpd": 10,
        "dew_point": 12,
        "fan_rpm": 14,
        "address": 40,
        "model": 42,
        "serial": 44,
        "baudrate": 46,
        "parity": 48,
        "stopbits": 50,
        "device_status": 52,
        "firmware_version": 54,
        "factory_PAR_multiplier": 56,
        "PAR_multiplier": 58,
        "PAR_offset": 60,
        "temp_offset": 62,
        "humidity_offset": 64,
        "co2_offset": 66,
        "running_average": 68, 
        "bluetooth_control": 70, 
        "LED_control": 72, 
        "fan_duty_cycle": 74, 
        "darkness_threshold": 76, 
        "modbus_measurement_control": 78, 
    }
}