Skip to content

Commit 9ba6271

Browse files
feat: implement base cooler artifact without logic
1 parent d1543f7 commit 9ba6271

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright (c) 2023. Smart Operating Block
3+
*
4+
* Use of this source code is governed by an MIT-style
5+
* license that can be found in the LICENSE file or at
6+
* https://opensource.org/licenses/MIT.
7+
*/
8+
9+
package artifact.environment;
10+
11+
import cartago.Artifact;
12+
import cartago.OPERATION;
13+
14+
import java.util.logging.Logger;
15+
16+
/**
17+
* CArtAgO artifact that is responsible for the communication with the hvac system of the operating block respect
18+
* to the cooling part.
19+
*/
20+
public class Cooler extends Artifact {
21+
private String roomId;
22+
23+
/**
24+
* Initialize the cooler artifact.
25+
* @param roomId the id of the room where the cooler is placed
26+
*/
27+
void init(final String roomId) {
28+
this.roomId = roomId;
29+
}
30+
31+
/**
32+
* Turn on the cooling system.
33+
*/
34+
@OPERATION
35+
void turnOn() {
36+
Logger.getLogger(Cooler.class.toString()).info("[" + this.roomId + "]" + " ON");
37+
}
38+
39+
/**
40+
* Turn off the cooling system.
41+
*/
42+
@OPERATION
43+
void turnOff() {
44+
Logger.getLogger(Cooler.class.toString()).info("[" + this.roomId + "]" + " OFF");
45+
}
46+
}

0 commit comments

Comments
 (0)