Class AbstractVariableLight

All Implemented Interfaces:
Comparable<NamedBean>, AnalogIO, PropertyChangeProvider, DigitalIO, Light, NamedBean, VariableLight
Direct Known Subclasses:
AnymaDMX_UsbLight, SerialLight

public abstract class AbstractVariableLight
extends AbstractLight
implements VariableLight
Abstract class providing partial implementation of the logic of the Light interface when the Intensity is variable.

Now it includes the transition code, but it only does the steps on the fast minute clock. Later it may do its own timing but this was simple to piggy back on the fast minute listener.

The structure is in part dictated by the limitations of the X10 protocol and implementations. However, it is not limited to X10 devices only. Other interfaces that have a way to provide a dimmable light should use it.

X10 has on/off commands, and separate commands for setting a variable intensity via "dim" commands. Some X10 implementations use relative dimming, some use absolute dimming. Some people set the dim level of their Lights and then just use on/off to turn control the lamps; in that case we don't want to send dim commands. Further, X10 communications is very slow, and sending a complete set of dim operations can take a long time. So the algorithm is:

  • Until the intensity has been explicitly set different from 1.0 or 0.0, no intensity commands are to be sent over the power line.

Unlike the parent class, this stores CurrentIntensity and TargetIntensity in separate variables.