Skip to content

Commit

Permalink
Change parameter representation.
Browse files Browse the repository at this point in the history
Parameter.device should be passed as object representation instead of class name.
  • Loading branch information
denpamusic committed Feb 22, 2025
1 parent 3618399 commit 9444ceb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyplumio/helpers/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __repr__(self) -> str:
"""Return a serializable string representation."""
return (
f"{self.__class__.__name__}("
f"device={self.device.__class__.__name__}, "
f"device={self.device}, "
f"description={self.description}, "
f"values={self.values}, "
f"index={self._index})"
Expand Down
4 changes: 2 additions & 2 deletions tests/helpers/test_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def test_switch_int(switch: Switch) -> None:
def test_number_repr(number: Number) -> None:
"""Test a number representation."""
assert repr(number) == (
"Number(device=EcoMAX, "
f"Number(device={number.device}, "
"description=NumberDescription(name='test_number', optimistic=False, "
"unit_of_measurement=<UnitOfMeasurement.CELSIUS: '°C'>), "
"values=ParameterValues(value=1, min_value=0, max_value=5), "
Expand All @@ -295,7 +295,7 @@ def test_number_repr(number: Number) -> None:
def test_switch_repr(switch: Switch) -> None:
"""Test a number representation."""
assert repr(switch) == (
"Switch(device=EcoMAX, "
f"Switch(device={switch.device}, "
"description=SwitchDescription(name='test_switch', optimistic=False), "
"values=ParameterValues(value=0, min_value=0, max_value=1), "
"index=0)"
Expand Down

0 comments on commit 9444ceb

Please sign in to comment.