cocluto/ClusterController/PowerState.py

22 lines
393 B
Python
Raw Normal View History

class PowerState:
UNKNOWN=0
OFF=1
ON=2
SLEEP=3
UNPLUGGED=4
def PowerStateToStr( powerState ):
if powerState == PowerState.UNKNOWN:
return 'UNKNOWN'
if powerState == PowerState.OFF:
return 'OFF'
if powerState == PowerState.ON:
return 'ON'
if powerState == PowerState.SLEEP:
return 'SLEEP'
if powerState == PowerState.UNPLUGGED:
return 'UNPLUGGED'
else:
assert( False )