public class RS485Switch extends AbstractSwitch implements DriverDepending, Reloadable
KEY_SWITCHON and
KEY_SWITCHOFF.#KEY_BIND is true.DriverDepending
interface.KEY_INITOFF key.
#turnOnTimeout method switches on, but switches
off again after the stated period.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private static boolean |
DEFINITOFF
The initial state of the switch.
|
static String |
KEY_INITOFF
The key defining initial off.
|
static String |
KEY_SERIAL
The name of the serial server to use.
|
static String |
KEY_SWITCHOFF
The serial command for light off.
|
static String |
KEY_SWITCHON
The serial command for light on.
|
private RS485Server |
serial
The serial server to send commands to.
|
KEY_INITBOOLEANKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
RS485Switch(Map prop)
Constructs a new light switch trigger.
|
| Modifier and Type | Method and Description |
|---|---|
void |
init()
Initializes the light switch.
|
protected boolean |
off()
Turn the light off.
|
protected boolean |
on()
Turns the switch on.
|
boolean |
registerDriver(Driver rs485)
Registers the driver.
|
double |
rescanned(String key,
String old,
String newval)
As any parameter depending instance we fail if the parameter we depend
on is now a different one.
|
turnOff, turnOngetLastToggleTime, getTrigger, setTriggerget, getElapsedToggleTime, isTrue, set, toggleTriggercreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreloaddefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiesgetElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTriggerpublic static final String KEY_SERIAL
public static final String KEY_SWITCHON
public static final String KEY_SWITCHOFF
public static final String KEY_INITOFF
private static final boolean DEFINITOFF
private RS485Server serial
public RS485Switch(Map prop)
public void init()
throws InitException
init in interface Initializableinit in class SimpleTriggerInitExceptionpublic double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class SimpleTriggerpublic boolean registerDriver(Driver rs485)
PollingRS485Server. If so, it's name is check to match the
KEY_SERIAL name. If this, too, is fulfilled, the server is
passed to the super-method, which does the necessary cache change
registration. Additionally an instance of this server is stored locally
to allow sending of commands to the serial server.registerDriver in interface DriverDependingprotected boolean on()
on in class AbstractSwitchprotected boolean off()
off in class AbstractSwitch