House lights come in two forms: auto-dimming and standard. Every light is associated with exactly one toggle switch, and every toggle switch is associated with exactly one light. Toggle switches have the operationtoggle. Lights have the operationsturn_on,turn_off, andtoggle. All lights also have a booleanis_onattribute. Auto-dimming lights also have an attributeseconds_to_offand a methodtick. There is a master switch for the whole house with two operations:enableandall_off. All lights are associated with this switch.
toggle operation by turning on if they
were off and off if they were on.toggle operation by turning on if they were off. However,
if they are on, respond to a toggle by turning off after
30 seconds. If the toggle switch is not pressed at all, the light
turns off after 600 seconds (10 minutes). The initial state should be
off for both, and both respond to the turn_off command
from the master switch by going off immediately.
A solution is
available: house-lights-solution.qea