enums.py 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. class Enum(type):
  2. def __getitem__(self, item):
  3. return getattr(self, item)
  4. @property
  5. def members(self):
  6. return sorted([item for item in list(set(dir(self)) - set(dir(Enum))) if not item.startswith("_")])
  7. @property
  8. def values(self):
  9. return [self[item] for item in self.members]
  10. class EVENT_STATUS(metaclass=Enum):
  11. NONE = "none"
  12. FAR = "far"
  13. NEAR = "near"
  14. ACTIVE = "active"
  15. COMPLETED = "completed"
  16. CANCELLED = "cancelled"
  17. class SIGNAL_TYPE(metaclass=Enum):
  18. DELTA = "delta"
  19. LEVEL = "level"
  20. MULTIPLIER = "multiplier"
  21. PRICE = "price"
  22. PRICE_MULTIPLIER = "priceMultiplier"
  23. PRICE_RELATIVE = "priceRelative"
  24. SETPOINT = "setpoint"
  25. X_LOAD_CONTROL_CAPACITY = "x-loadControlCapacity"
  26. X_LOAD_CONTROL_LEVEL_OFFSET = "x-loadControlLevelOffset"
  27. X_LOAD_CONTROL_PERCENT_OFFSET = "x-loadControlPorcentOffset"
  28. X_LOAD_CONTROL_SETPOINT = "x-loadControlSetpoint"
  29. class SIGNAL_NAME(metaclass=Enum):
  30. SIMPLE = "SIMPLE"
  31. simple = "simple"
  32. ELECTRICITY_PRIC = "ELECTRICITY_PRICE"
  33. ENERGY_PRICE = "ELECTRICITY_PRICE"
  34. DEMAND_CHARGE = "DEMAND_CHARGE"
  35. BID_PRICE = "BID_PRICE"
  36. BID_LOAD = "BID_LOAD"
  37. BID_ENERGY = "BID_ENERGY"
  38. CHARGE_STATE = "CHARGE_STATE"
  39. LOAD_DISPATCH = "LOAD_DISPATCH"
  40. LOAD_CONTROL = "LOAD_CONTROL"
  41. class SI_SCALE_CODE(metaclass=Enum):
  42. p = "p"
  43. n = "n"
  44. micro = "micro"
  45. m = "m"
  46. c = "c"
  47. d = "d"
  48. k = "k"
  49. M = "M"
  50. G = "G"
  51. T = "T"
  52. none = "none"
  53. class OPT(metaclass=Enum):
  54. OPT_IN = "optIn"
  55. OPT_OUT = "optOut"
  56. class OPT_REASON(metaclass=Enum):
  57. ECONOMIC = "economic"
  58. EMERGENCY = "emergency"
  59. MUST_RUN = "mustRun"
  60. NOT_PARTICIPATING = "notParticipating"
  61. OUTAGE_RUN_STATUS = "outageRunStatus"
  62. OVERRIDE_STATUS = "overrideStatus"
  63. PARTICIPATING = "participating"
  64. X_SCHEDULE = "x-schedule"
  65. class READING_TYPE(metaclass=Enum):
  66. DIRECT_READ = "Direct Read"
  67. NET = "Net"
  68. ALLOCATED = "Allocated"
  69. ESTIMATED = "Estimated"
  70. SUMMED = "Summed"
  71. DERIVED = "Derived"
  72. MEAN = "Mean"
  73. PEAK = "Peak"
  74. HYBRID = "Hybrid"
  75. CONTRACT = "Contract"
  76. PROJECTED = "Projected"
  77. X_RMS = "x-RMS"
  78. X_NOT_APPLICABLE = "x-notApplicable"
  79. class REPORT_TYPE(metaclass=Enum):
  80. READING = "reading"
  81. USAGE = "usage"
  82. DEMAND = "demand"
  83. SET_POINT = "setPoint"
  84. DELTA_USAGE = "deltaUsage"
  85. DELTA_SET_POINT = "deltaSetPoint"
  86. DELTA_DEMAND = "deltaDemand"
  87. BASELINE = "baseline"
  88. DEVIATION = "deviation"
  89. AVG_USAGE = "avgUsage"
  90. AVG_DEMAND = "avgDemand"
  91. OPERATING_STATE = "operatingState"
  92. UP_REGULATION_CAPACITY_AVAILABLE = "upRegulationCapacityAvailable"
  93. DOWN_REGULATION_CAPACITY_AVAILABLE = "downRegulationCapacityAvailable"
  94. REGULATION_SETPOINT = "regulationSetpoint"
  95. STORED_ENERGY = "storedEnergy"
  96. TARGET_ENERGY_STORAGE = "targetEnergyStorage"
  97. AVAILABLE_ENERGY_STORAGE = "availableEnergyStorage"
  98. PRICE = "price"
  99. LEVEL = "level"
  100. POWER_FACTOR = "powerFactor"
  101. PERCENT_USAGE = "percentUsage"
  102. PERCENT_DEMAND = "percentDemand"
  103. X_RESOURCE_STATUS = "x-resourceStatus"
  104. class REPORT_NAME(metaclass=Enum):
  105. METADATA_HISTORY_USAGE = "METADATA_HISTORY_USAGE"
  106. HISTORY_USAGE = "HISTORY_USAGE"
  107. METADATA_HISTORY_GREENBUTTON = "METADATA_HISTORY_GREENBUTTON"
  108. HISTORY_GREENBUTTON = "HISTORY_GREENBUTTON"
  109. METADATA_TELEMETRY_USAGE = "METADATA_TELEMETRY_USAGE"
  110. TELEMETRY_USAGE = "TELEMETRY_USAGE"
  111. METADATA_TELEMETRY_STATUS = "METADATA_TELEMETRY_STATUS"
  112. TELEMETRY_STATUS = "TELEMETRY_STATUS"