const timeoutInterval = 150000;

const deviceConfig = [
  {
    device: "em340",
    deviceAddress: 1,
    stream: [
      {
        "tbAttribute": "Phase_1_voltage",
        "register": 0,
        "size": 2,
        "multiplier": 0.1
      },
      {
        "tbAttribute": "Phase_2_voltage",
        "register": 2,
        "size": 2,
        "multiplier": 0.1
      },
      {
        "tbAttribute": "Phase_3_voltage",
        "register": 4,
        "size": 2,
        "multiplier": 0.1
      },
     {
       "tbAttribute": "Phase_1_current",
       "register": 12,
       "size": 2,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "Phase_2_current",
       "register": 14,
       "size": 2,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "Phase_3_current",
       "register": 16,
       "size": 2,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "Phase_1_power",
       "register": 18,
       "size": 2,
       "multiplier": 0.1
     },
     {
       "tbAttribute": "Phase_2_power",
       "register": 20,
       "size": 2,
       "multiplier": 0.1
     },
     {
       "tbAttribute": "Phase_3_power",
       "register": 22,
       "size": 2,
       "multiplier": 0.1
     },
     {
       "tbAttribute": "total_power",
       "register": 40,
       "size": 2,
       "multiplier": 0.1
     },
     {
       "tbAttribute": "total_energy",
       "register": 52,
       "size": 2,
       "multiplier": 0.1
     },
     {
       "tbAttribute": "Phase_1_pow_factor",
       "register": 46,
       "size": 1,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "Phase_2_pow_factor",
       "register": 47,
       "size": 1,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "Phase_3_pow_factor",
       "register": 48,
       "size": 1,
       "multiplier": 0.001
     },
     {
       "tbAttribute": "power_factor",
       "register": 49,
       "size": 1,
       "multiplier": 0.001
     }
    ]
  },
  {
    device: "twilight_sensor",
    deviceAddress: 2,
    stream: [
      {  
        "tbAttribute": "twilight_sensor",
        "register": 60,
        "size": 2,
        "multiplier": 1
      }
    ]
  } 
];

module.exports = { timeoutInterval, deviceConfig };