def test_setpoint_init_from_idf_humidity(): """Test the initialization of Setpoint from_idf with humidity setpoints.""" simple_heat = ScheduleDay( 'Simple Weekday HtgSetp', [18, 21, 18], [Time(0, 0), Time(9, 0), Time(17, 0)]) simple_cool = ScheduleDay( 'Simple Weekday ClgSetp', [28, 24, 28], [Time(0, 0), Time(9, 0), Time(17, 0)]) heat_setpt = ScheduleRuleset('Office Heating', simple_heat, None, schedule_types.temperature) cool_setpt = ScheduleRuleset('Office Cooling', simple_cool, None, schedule_types.temperature) humid_setpt = ScheduleRuleset.from_constant_value('Office Humid', 30, schedule_types.humidity) dehumid_setpt = ScheduleRuleset.from_constant_value( 'Office Dehumid', 60, schedule_types.humidity) setpoint = Setpoint('Office Setpoint', heat_setpt, cool_setpt, humid_setpt, dehumid_setpt) sched_dict = { heat_setpt.identifier: heat_setpt, cool_setpt.identifier: cool_setpt, humid_setpt.identifier: humid_setpt, dehumid_setpt.identifier: dehumid_setpt } zone_id = 'Test Zone' idf_str = setpoint.to_idf(zone_id) humid_idf_str = setpoint.to_idf_humidistat(zone_id) rebuilt_setpoint = Setpoint.from_idf(idf_str, sched_dict) rebuilt_setpoint.add_humidity_from_idf(humid_idf_str, sched_dict) assert setpoint == rebuilt_setpoint
def test_setpoint_init_from_idf(): """Test the initialization of Setpoint from_idf.""" simple_heat = ScheduleDay( 'Simple Weekday HtgSetp', [18, 21, 18], [Time(0, 0), Time(9, 0), Time(17, 0)]) simple_cool = ScheduleDay( 'Simple Weekday ClgSetp', [28, 24, 28], [Time(0, 0), Time(9, 0), Time(17, 0)]) heat_setpt = ScheduleRuleset('Office Heating', simple_heat, None, schedule_types.temperature) cool_setpt = ScheduleRuleset('Office Cooling', simple_cool, None, schedule_types.temperature) setpoint = Setpoint('Office Setpoint', heat_setpt, cool_setpt) sched_dict = {heat_setpt.name: heat_setpt, cool_setpt.name: cool_setpt} idf_str = setpoint.to_idf() rebuilt_setpoint = Setpoint.from_idf(idf_str, sched_dict) assert setpoint == rebuilt_setpoint