File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/env/artifact/environment/roomartifact Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import cartago .OPERATION ;
12
12
import entity .actuator .ActuatorType ;
13
+ import entity .actuator .DimmableActuator ;
13
14
import entity .room .RoomID ;
15
+ import infrastructure .wot .WotInvoker ;
14
16
15
17
import java .util .logging .Logger ;
16
18
19
21
* Operating Block.
20
22
*/
21
23
public class AmbientLight extends AbstractActuatorInRoomArtifact implements DimmableArtifact {
24
+ private DimmableActuator actuator ;
25
+ private WotInvoker wotInvoker ;
22
26
/**
23
27
* Initialize the ambient light artifact.
24
28
* @param roomId the room id where the ambient light is placed.
25
29
*/
26
30
void init (final String roomId ) {
27
31
super .init (ActuatorType .AMBIENT_LIGHT , new RoomID (roomId ));
32
+ this .actuator = new DimmableActuator (this .getActuatorID ());
33
+ this .wotInvoker = new WotInvoker ();
28
34
}
29
35
30
36
@ Override
31
37
@ OPERATION
32
38
public final void setIntensity (final int luxToSet ) {
33
39
Logger .getLogger (AmbientLight .class .toString ())
34
40
.info ("[" + this .getRoomId ().getId () + "] " + this .getActuatorID ().getId () + " Set " + luxToSet + " LUX" );
41
+ this .actuator .setIntensity (luxToSet , this .wotInvoker );
35
42
}
36
43
}
You can’t perform that action at this time.
0 commit comments