Exemplo n.º 1
0
class LampController:
    def __init__(self):
        self.lamp = Lamp()

    def set_on(self):
        # Change lamp status to ON
        self.lamp.set_on()

    def get_status(self):
        # Returns True if lamp is ON
        return self.lamp.is_on()
Exemplo n.º 2
0
class LampController:
    def __init__(self):
        self.lamp = Lamp()

    def turn_on(self):
        self.lamp.set_on()

    def turn_off(self):
        self.lamp.set_off()

    def is_on(self):
        return self.lamp.get_state()