export type StaticData = {
  label: string;
  value: string | number;
}[];

export const HEAT_PUMP_CONFIGURATION_MODES: StaticData = [
  { label: 'OFF', value: 0 },
  { label: 'Automatic: Water tank heating/Room heating', value: 1 },
  { label: 'Room heating', value: 2 },
  { label: 'Water tank heating', value: 4 },
  { label: 'Defrosting', value: 8 },
  { label: 'Room cooling', value: 16 },
  { label: 'Automatic: Water tank heating/Room cooling', value: 32 },
  { label: 'Test mode', value: 64 },
];

export const HEAT_PUMP_STATE_MODES: Record<number, string> = {
  0: 'OFF',
  1: 'Automatic',
  2: 'Heating',
  4: 'Water tank heating',
  8: 'Recycling refridgerant',
  16: 'Cooling',
} as const;

export const HEAT_PUMP_MODELS: Record<number, string> = {
  1: 'Single tank model',
  2: 'Single room heating model',
  3: 'Water tank plus room heating model',
  4: 'Single room cooling model',
  5: 'Water tank plus room cooling model',
  6: 'Room heating and cooling models',
  7: 'Water tank plus room heating and cooling',
  15: 'Water tank plus room cooling model with solar energy',
} as const;

export const FAULT_MESSAGES_1: Record<number, string> = {
  1: 'Module board failure',
  2: 'Switchboard and outdoor main control board communication protection - Low protection',
  4: 'Outdoor main control board and drive chip communication protection',
  8: 'Ambient temperature sensor is open or shorted',
  16: 'Voltage is too high / too low protection',
  32: 'EEPROM error indication (conversion board)',
  64: 'Self-test when the emergency switch open',
  128: 'The exhaust temperature sensor is open or shorted',
} as const;

export const FAULT_MESSAGES_2: Record<number, string> = {
  1: 'The return water temperature sensor is open or shorted',
  2: 'The tank temperature sensor is open or shorted',
  4: 'The water temperature sensor is open or shorted',
  8: 'Water protection',
  16: 'Pressure relief protection',
  32: 'The condenser temperature sensor is open or shorted',
  64: 'System pressure low protection',
  128: 'System pressure high protection',
} as const;

export const FAULT_MESSAGES_3: Record<number, string> = {
  1: 'Solar collector (room) temperature sensor failure',
  2: 'Excessive exhaust temperature protection',
  4: 'The temperature of the cooling condenser is too high',
  8: 'Return air temperature sensor failure',
  16: 'Temperature sensor failure after throttling',
  32: 'High Current protect',
  128: 'High Water supply protection',
} as const;

export const FAULT_MESSAGES_4: Record<number, string> = {
  1: 'Too low Refrigeration effluent temperature protection',
  2: 'Out of the water temperature difference protection',
  8: 'Anti-freeze protection',
} as const;

export const STATUS_FLAG_MESSAGES_1: Record<number, string> = {
  1: 'Defrost flag, 1 for defrost',
  16: 'Self-check mark, 1 for self-test',
} as const;

export const STATUS_FLAG_MESSAGES_2: Record<number, string> = {
  1: 'Make cooling to temperature mark',
  2: 'Making heating to temperature mark',
} as const;

export const ELECTRIC_HEATING_FLAG_MESSAGES: Record<number, string> = {
  1: 'Electrical heating 1',
  2: 'Electrical heating 2',
  4: 'Electrical heating 3',
  8: 'Solar Energy Heat Pump',
  16: 'Water Pump',
  32: 'Outdoor fan high wind',
  64: 'Outdoor fan middle wind',
  128: 'Outdoor fan low wind',
} as const;
