Skip to content

Commit 00dfdd1

Browse files
feat: implement ventilation actions
1 parent 31effc5 commit 00dfdd1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/env/artifact/environment/roomartifact/Ventilation.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
import cartago.OPERATION;
1212
import entity.actuator.ActuatorType;
13+
import entity.actuator.DimmableActuator;
1314
import entity.room.RoomID;
15+
import infrastructure.wot.WotInvoker;
1416

1517
import java.util.logging.Logger;
1618

@@ -19,12 +21,16 @@
1921
* to the ventilation part.
2022
*/
2123
public class Ventilation extends AbstractActuatorInRoomArtifact implements DimmableArtifact {
24+
private DimmableActuator actuator;
25+
private WotInvoker wotInvoker;
2226
/**
2327
* Initialize the ventilation artifact.
2428
* @param roomId the room id where the ventilation is placed.
2529
*/
2630
void init(final String roomId) {
2731
super.init(ActuatorType.VENTILATION, new RoomID(roomId));
32+
this.actuator = new DimmableActuator(this.getActuatorID());
33+
this.wotInvoker = new WotInvoker();
2834
}
2935

3036
@Override
@@ -36,5 +42,6 @@ public final void setIntensity(final int intensityPercentage) {
3642

3743
Logger.getLogger(Ventilation.class.toString())
3844
.info("[" + this.getRoomId() + "] " + this.getActuatorID().getId() + " Set " + intensityPercentage);
45+
this.actuator.setIntensity(intensityPercentage, this.wotInvoker);
3946
}
4047
}

0 commit comments

Comments
 (0)