-
Notifications
You must be signed in to change notification settings - Fork 0
/
House.py
30 lines (24 loc) · 829 Bytes
/
House.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class House:
def __init__(self, rooms, upstairs, downstairs, season, equipmentStatus):
self.rooms = rooms
self.upstairs = upstairs
self.downstairs = downstairs
self.season = season
self.fanStatus = self.fanState(equipmentStatus)
self.hvacStatus = self.hvacState(equipmentStatus)
def openAllVents(self):
for room in self.rooms:
if room.vent is not None:
room.openVent()
def hvacState(self, equipmentStatus):
if 'heat' == equipmentStatus:
return 'heat'
elif 'cool' == equipmentStatus:
return 'cool'
else:
return equipmentStatus
def fanState(self, equipmentStatus):
if 'fan' == equipmentStatus:
return 'on'
else:
return 'off'