12 lines
342 B
C++

#include "GarageDoor.h"
GarageDoor::GarageDoor(std::string id, std::string name, bool open) :Device(id, name), open(open){}
std::string GarageDoor::isOpen() const {
return (open) ? "open" : "closed";
}
std::string GarageDoor::toString() const {
return " id: " + id + " name: " + name + " is open: " + isOpen() + "\n";
}