12 lines
327 B
C++

#include "Light.h"
Light::Light(std::string id, std::string name, bool turnedOn) : Device(id, name), turnedOn(turnedOn) {}
std::string Light::isOn() const {
return (turnedOn) ? "on" : "off";
}
std::string Light::toString() const {
return " id: " + id + " name: " + name + " turnedOn: " + isOn() + "\n";
}