first commit
This commit is contained in:
25
helix/constants/inverter_brand.py
Normal file
25
helix/constants/inverter_brand.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from enum import IntEnum
|
||||
|
||||
|
||||
class InverterBrand(IntEnum):
|
||||
SMA = 1
|
||||
DELTA = 2
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
return {
|
||||
self.SMA: 'SMA',
|
||||
self.DELTA: 'Delta',
|
||||
}[self]
|
||||
|
||||
@classmethod
|
||||
def default_value(cls):
|
||||
return cls.SMA.value
|
||||
|
||||
@classmethod
|
||||
def all(cls):
|
||||
return [cls.SMA, cls.DELTA]
|
||||
|
||||
@classmethod
|
||||
def dict(cls):
|
||||
return {cls.SMA.label: cls.SMA.value, cls.DELTA.label: cls.DELTA.value}
|
||||
Reference in New Issue
Block a user