26 lines
478 B
Python
26 lines
478 B
Python
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}
|