Skip to content

Commit

Permalink
updating equipment types to prevent dual fuel and other from being co…
Browse files Browse the repository at this point in the history
…unted
  • Loading branch information
craigmaloney committed Oct 14, 2020
1 parent 0a22561 commit 6adff73
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
9 changes: 6 additions & 3 deletions tests/test_equipment_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ def test_has_heating():
'furnace_or_boiler', # Non heat pump heating (gas or oil furnace, electric resistance)
'heat_pump_electric_backup', # Heat pump with electric resistance heat (strip heat)
'heat_pump_no_electric_backup', # Heat pump without electric resistance heat
]:
assert(has_heating(i) is True)
for i in [
'heat_pump_dual_fuel', # Dual fuel heat pump (e.g. gas or oil fired)
'other', # Multi-zone, ?
'none', # None
]:
assert(has_heating(i) is True)
assert(has_heating('none') is False)
assert(has_heating(i) is False)
assert(has_heating(None) is False)
assert(validate_heat_type('furnace_or_boiler') is True)
assert(validate_heat_type('bogus_heat_pump') is False)
Expand All @@ -55,10 +58,10 @@ def test_has_cooling():
for i in [
'heat_pump', # Heat pump w/ cooling
'central', # Central AC
'other', # Mini-split, evaporative cooler, ?
]:
assert(has_cooling(i) is True)
assert(has_cooling('none') is False)
assert(has_cooling('other') is False)
assert(has_cooling(None) is False)
assert(validate_cool_type('heat_pump') is True)
assert(validate_cool_type('bogus_pump') is False)
Expand Down
14 changes: 10 additions & 4 deletions thermostat/equipment_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,16 @@ def has_heating(heat_type):
-------
boolean
"""
if heat_type is None:
return False
if heat_type == 'none':
return False
if heat_type == 'other':
return False
if heat_type == 'heat_pump_dual_fuel':
return False
if heat_type in HEAT_TYPE:
return True
if heat_type is None:
return False
return False


Expand All @@ -95,12 +99,14 @@ def has_cooling(cool_type):
-------
boolean
"""
if cool_type is None:
return False
if cool_type == 'none':
return False
if cool_type == 'other':
return False
if cool_type in COOL_TYPE:
return True
if cool_type is None:
return False
return False


Expand Down

0 comments on commit 6adff73

Please sign in to comment.