lib/openstudio-standards/standards/necb/NECB2011/lighting.rb in openstudio-standards-0.2.12 vs lib/openstudio-standards/standards/necb/NECB2011/lighting.rb in openstudio-standards-0.2.13.rc3

- old
+ new

@@ -1,10 +1,28 @@ class NECB2011 def apply_standard_lights(set_lights: true, - space_type:, space_type_properties:, - lights_type: 'NECB_Default', - lights_scale: 1.0) + space_type:, + space_type_properties:, + lights_type:, + lights_scale:) + + ##### Remove leading or trailing whitespace in case users add them in inputs + if lights_scale.instance_of?(String) + lights_scale = lights_scale.strip + end + + if lights_type.nil? || lights_type == 'none' + lights_type = 'NECB_Default' + end + if lights_scale.nil? || lights_scale == 'none' || lights_scale == 'NECB_Default' + lights_scale = 1.0 + end + + ##### Convert a string to a float + if lights_scale.instance_of?(String) + lights_scale = lights_scale.to_f + end lights_have_info = false lighting_per_area = space_type_properties['lighting_per_area'].to_f lighting_per_person = space_type_properties['lighting_per_person'].to_f lights_frac_to_return_air = space_type_properties['lighting_fraction_to_return_air'].to_f