Skip to content

Commit

Permalink
fix(eplus): add_lighting
Browse files Browse the repository at this point in the history
  • Loading branch information
TammieYu committed Oct 26, 2023
1 parent 409be06 commit 97882e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions frads/eplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ def actuate_heating_setpoint(self, zone: str, value: float):
value=value,
)

def actuate_lighting_power(self, zone: str, value: float):
def actuate_lighting_power(self, light_name: str, value: float):
"""Set lighting power for a zone.
Args:
zone: The name of the zone to set the lighting power for.
light_name: The name of the lighting object to set the lighting power for.
value: The value to set the lighting power to.
Example:
Expand All @@ -237,7 +237,7 @@ def actuate_lighting_power(self, zone: str, value: float):
self.actuate(
component_type="Lights",
name="Electricity Rate",
key=zone,
key=light_name,
value=value,
)

Expand Down Expand Up @@ -508,7 +508,7 @@ def get_zone_from_pair_arg(node: ast.Call) -> str:
key_value = ["Zone Temperature Control", "Heating Setpoint", zone]
elif node.func.attr == "actuate_lighting_power":
zone = get_zone_from_pair_arg(node)
key_value = ["Lights", "Lighting Level", zone]
key_value = ["Lights", "Electricity Rate", zone]
if key_value is None:
continue
if key_value not in self.actuators:
Expand Down
8 changes: 4 additions & 4 deletions frads/eplus_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ def add_lighting(self, zone: str, replace: bool = False):
dict2 = copy.deepcopy(self.lights)

if self.lights is not None:
for light in dict2.values():
if light.zone_or_zonelist_or_space_or_spacelist_name == zone:
for k, v in dict2.items():
if v.zone_or_zonelist_or_space_or_spacelist_name == zone:
if replace:
del light
del self.lights[k]
else:
raise ValueError(
f"Lighting already exists in zone = {zone}. "
Expand Down Expand Up @@ -150,7 +150,7 @@ def add_lighting(self, zone: str, replace: bool = False):
# Add lighting to epjs dictionary
self.add(
"lights",
f"Light_{zone}",
zone,
epm.Lights(
design_level_calculation_method=epm.DesignLevelCalculationMethod.lighting_level,
fraction_radiant=0,
Expand Down

0 comments on commit 97882e0

Please sign in to comment.