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
* to the ventilation part.
20
22
*/
21
23
public class Ventilation extends AbstractActuatorInRoomArtifact implements DimmableArtifact {
24
+ private DimmableActuator actuator ;
25
+ private WotInvoker wotInvoker ;
22
26
/**
23
27
* Initialize the ventilation artifact.
24
28
* @param roomId the room id where the ventilation is placed.
25
29
*/
26
30
void init (final String roomId ) {
27
31
super .init (ActuatorType .VENTILATION , new RoomID (roomId ));
32
+ this .actuator = new DimmableActuator (this .getActuatorID ());
33
+ this .wotInvoker = new WotInvoker ();
28
34
}
29
35
30
36
@ Override
@@ -36,5 +42,6 @@ public final void setIntensity(final int intensityPercentage) {
36
42
37
43
Logger .getLogger (Ventilation .class .toString ())
38
44
.info ("[" + this .getRoomId () + "] " + this .getActuatorID ().getId () + " Set " + intensityPercentage );
45
+ this .actuator .setIntensity (intensityPercentage , this .wotInvoker );
39
46
}
40
47
}
You can’t perform that action at this time.
0 commit comments