1 package iotcode.interfaces;
4 import java.rmi.Remote;
5 import java.rmi.RemoteException;
7 /** Class LightBulb interface for the light bulb devices.
9 * @author Ali Younis <ayounis @ uci.edu>
15 public interface LightBulb extends Remote {
17 /** Method to turn the light bulb on (Physically illuminate the area).
21 * @return [void] None.
24 public void turnOff() throws RemoteException;
26 /** Method to turn the light bulb off.
28 * @return [void] None.
30 public void turnOn() throws RemoteException;
33 /** Method to get the current on/off state of the light bulb.
35 * @return [boolean] True means bulb on.
37 public boolean getState() throws RemoteException;
40 /** Method to set the light bulb color using Standard Hue, Saturation and Brightness
41 * conventions. See "http://www.tydac.ch/color/" for reference.
43 * @param _hue [double]: Hue value (in degrees).
44 * @param _saturation [double]: Saturation value (percentage).
45 * @param _brightness [double]: Brightness value (percentage).
47 * @return [void] None.
49 public void setColor(double _hue, double _saturation, double _brightness) throws RemoteException;
52 /** Method to set the color temperature.
54 * @param _temperature [int]: Color temperature in degrees kelvin.
56 * @return [void] None.
58 public void setTemperature(int _temperature) throws RemoteException;
61 /** Method to get the current hue value of the bulb.
63 * @return [double] Current hue value of the bulb in degrees.
65 public double getHue() throws RemoteException;
68 /** Method to get the current saturation value of the bulb.
70 * @return [double] Current saturation value of the bulb as a percentage.
72 public double getSaturation() throws RemoteException;
75 /** Method to get the current brightness value of the bulb.
77 * @return [double] Current brightness value of the bulb as a percentage.
79 public double getBrightness() throws RemoteException;
82 /** Method to get the current color temperature value of the bulb.
84 * @return [double] Current color temperature value of the bulb in kelvin.
86 public int getTemperature() throws RemoteException;
89 /** Method to get the hue range lower bound supported by the bulb.
91 * @return [double] Hue lower bound in degrees.
93 public double getHueRangeLowerBound() throws RemoteException;
96 /** Method to get the hue range upper bound supported by the bulb.
98 * @return [double] Hue upper bound in degrees.
100 public double getHueRangeUpperBound() throws RemoteException;
103 /** Method to get the saturation range lower bound supported by the bulb.
105 * @return [double] Saturation lower bound as a percentage.
107 public double getSaturationRangeLowerBound() throws RemoteException;
110 /** Method to get the saturation range upper bound supported by the bulb.
112 * @return [double] Saturation upper bound as a percentage.
114 public double getSaturationRangeUpperBound() throws RemoteException;
117 /** Method to get the brightness range lower bound supported by the bulb.
119 * @return [double] Brightness lower bound as a percentage.
121 public double getBrightnessRangeLowerBound() throws RemoteException;
124 /** Method to get the brightness range upper bound supported by the bulb.
126 * @return [double] Brightness upper bound as a percentage.
128 public double getBrightnessRangeUpperBound() throws RemoteException;
131 /** Method to get the temperature range lower bound supported by the bulb.
133 * @return [int] Temperature lower bound as a percentage.
135 public int getTemperatureRangeLowerBound() throws RemoteException;
138 /** Method to get the temperature range upper bound supported by the bulb.
140 * @return [int] Temperature upper bound as a percentage.
142 public int getTemperatureRangeUpperBound() throws RemoteException;
145 /** Method to initialize the bulb, if the bulb needs to be initialized.
147 * @return [void] None.
149 public void init() throws RemoteException;