Created
July 26, 2011 14:25
-
-
Save axeda/1106882 to your computer and use it in GitHub Desktop.
Close Alarms on Condition script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.axeda.drm.sdk.data.*; | |
import com.axeda.drm.sdk.Context; | |
import java.util.*; | |
try{ | |
AlarmFinder alarmFinder = new AlarmFinder(Context.create()); | |
alarmFinder.setDevice(context.device); | |
List alarms = alarmFinder.findAll(); | |
for (Alarm alarm : alarms) | |
{ | |
//logger.info alarm.name; | |
if( alarm.getState() != AlarmState.CLOSED) { | |
alarm.setState(AlarmState.CLOSED, "") | |
} | |
} | |
} catch(Exception e) | |
{ | |
logger.info e.getMessage(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment