public class HumiditySwitch extends RS485Switch implements ParameterDepending, WeatherDependingParameter, DataListener, StatusProviding, RmiStatusProviding
KEY_HUMIDITY, the RS485 commands for
turning the dehumidifier on and off RS485Switch.KEY_SWITCHON and
RS485Switch.KEY_SWITCHOFF. The roof-closed trigger is a special one that
must be present in the environment master.
KEY_BIND is true.stella.io.DriverDepending,
ParameterDepending, and the WeatherDependingParameter
interfaces.Toggling instance id bound to this switch to make
reaction independent from weather casting, i.e. the KEY_JUDGE
key points to a triggering class name, normally a
SchmidtTrigger.
The parameters for the Toggling instance are raw-values of the
humidity sensor and given in KEY_JUDGEPARAMETERS.KEY_RETARDON and
KEY_RETARDOFF that retard proper switching after a toggle event
has been registered.KEY_TIMEOUT points to a value above zero, then the
dehumidifier is turned off automatically after the stated time.PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
private DataCaster |
bayhumidity
The data caster that delivers the humidity measurements.
|
private static boolean |
DEFBIND
The default auto-binding as a
RemoteParameter. |
private static String |
DEFBINDNAME
Default bind name.
|
private static String |
DEFHUMIDITY
The default humidity sensor to watch.
|
private static String |
DEFJUDGE
The class name of the default toggling instance.
|
private static String |
DEFJUDGEPARAMETERS
The default toggling instance parameters.
|
static String |
DEFNAME
The default parameter name.
|
private static long |
DEFRETARDOFF
The default time-out after which turn-off is again allowed.
|
private static long |
DEFRETARDON
The default time-out after which turn-on is again allowed.
|
private static String |
DEFSERIAL
The default serial driver name.
|
private static String |
DEFSWITCHOFF
The default serial command to switch on the light.
|
private static String |
DEFSWITCHON
The default serial command to switch on the light.
|
private static long |
DEFTIMEOUT
The default time out after which dehumidifier is turned off again.
|
static String |
KEY_BIND
The default binding behaviour.
|
static String |
KEY_HUMIDITY
The name of the humidity switch.
|
static String |
KEY_JUDGE
The class-name of the
Toggling instance. |
static String |
KEY_JUDGEPARAMETERS
The parameters to the
Toggling instance. |
static String |
KEY_RETARDOFF
The retard time for switching on again.
|
static String |
KEY_RETARDON
The retard time for switching on again.
|
static String |
KEY_TIMEOUT
The default time out for light switch off.
|
private long |
lastoff
The last time we successfully switched the dehumidifier off.
|
private long |
laston
The last time we successfully switched the dehumidifier on.
|
private double |
lastraw
The last valid raw humidity received.
|
private Trigger |
shut
The status of the roof.
|
private Toggling |
toggle
The
Toggling instance to judge for dehumidification-on. |
KEY_INITOFF, KEY_SERIAL, KEY_SWITCHOFF, KEY_SWITCHONKEY_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 |
|---|
HumiditySwitch(Map prop)
Constructs a new living reference of a cabinet switch.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
bindToRegistry()
Binds to registry.
|
String |
conciseStatus() |
void |
dataAvailable(DataEvent de)
Registers a new data event.
|
void |
exit()
We deregister from the humidity sensor prior to exiting.
|
Object |
extendedStatus()
As a stust, we provide also info on current weather etc.
|
Object |
getForWeather(WeatherSurveying weather)
Defined by the weather-depending interface, but not used here.
|
void |
init()
Initializes the
Toggling instance. |
void |
registerParameter(Parameter roof)
Registers the roof.
|
void |
registerWeather(WeatherSurveying sensors)
Registers a weather surveyor permanently to this parameter.
|
Object |
rmiProvideStatus()
As a stust, we provide also info on current weather etc.
|
boolean |
turnOff()
Additionally to turning the switch off, we must record the time for
proper retarding.
|
boolean |
turnOn(long timeout)
Additionally to turning the switch on, we must record the time for
proper retarding.
|
boolean |
unbindFromRegistry()
Unbinds from registry.
|
off, on, registerDriver, rescannedgetLastToggleTime, getTrigger, setTriggerget, getElapsedToggleTime, isTrue, set, toggleTriggercreateParameter, delivers, 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, waitdefaultBoolean, 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, stringPropertiesreloadgetElapsedToggleTime, getLastToggleTime, getTrigger, isTrue, setTrigger, toggleTriggerpublic static final String KEY_HUMIDITY
public static final String KEY_JUDGE
Toggling instance.public static final String KEY_JUDGEPARAMETERS
Toggling instance.public static final String KEY_RETARDON
public static final String KEY_RETARDOFF
public static final String KEY_TIMEOUT
public static final String KEY_BIND
public static final String DEFNAME
private static final String DEFSERIAL
private static final String DEFSWITCHON
private static final String DEFSWITCHOFF
private static final String DEFHUMIDITY
private static final String DEFJUDGE
private static final String DEFJUDGEPARAMETERS
private static final long DEFRETARDON
private static final long DEFRETARDOFF
private static final long DEFTIMEOUT
private static final boolean DEFBIND
RemoteParameter.private static final String DEFBINDNAME
private Trigger shut
private DataCaster bayhumidity
private double lastraw
private long laston
private long lastoff
public HumiditySwitch(Map prop) throws RemoteException
RemoteExceptionpublic void init()
throws InitException
Toggling instance.init in interface Initializableinit in class RS485SwitchInitExceptionpublic void registerParameter(Parameter roof)
registerParameter in interface ParameterDependingpublic Object getForWeather(WeatherSurveying weather)
getForWeather in interface WeatherDependingParameterpublic void registerWeather(WeatherSurveying sensors)
KEY_HUMIDITYregisterWeather in interface WeatherDependingParameterpublic void dataAvailable(DataEvent de)
dataAvailable in interface DataListenerpublic boolean bindToRegistry()
throws RemoteException
RemoteExceptionpublic boolean unbindFromRegistry()
throws RemoteException
RemoteExceptionpublic boolean turnOn(long timeout)
turnOn in interface SwitchturnOn in class AbstractSwitchtimeout - The maximum time the switch should be on (ms), zero for
unlimited.public boolean turnOff()
turnOff in interface SwitchturnOff in class AbstractSwitchpublic void exit()
exit in interface ExitCleaningexit in class AbstractParameterpublic Object extendedStatus()
extendedStatus in interface StatusProvidingpublic String conciseStatus()
conciseStatus in interface StatusProvidingpublic Object rmiProvideStatus() throws RemoteException
rmiProvideStatus in interface RmiStatusProvidingRemoteException