Static
readStatic
writeWrite the value of each switch to a byte.
The byte representation of the switches.
console.log(writeSwitches([ false, true, false, false, true ]));
// 0x12 (18)
An array of the value of each switch.
Set the value of a switch as flipped or not flipped
// Randomise each switch.
for (let i = 0; i < 5; i++) {
electrical.setSwitch(i, Math.random() > 0.5);
}
The ID of the switch to flip.
Whether the switch is flipped.
The current switch states.
The brightness of lights.
The switch states that are expected.
Optional
data: HazelReader | SwitchSystemDataReturn the room that this system belongs to.
Whether or not this system is sabotaged.
Generated using TypeDoc
Represents a system responsible for handling switches in Electrical.
See SwitchSystemEvents for events to listen to.