Use repr() for enum values in Feature.__repr__ ()

Instead of simply displaying the enum value, use repr to get a nicer
output for the cli.
Was: `Error (vacuum_error): 14`
Now: `Error (vacuum_error): <ErrorCode.DustBinRemoved: 14>`
This commit is contained in:
Teemu R. 2025-01-06 13:23:02 +01:00 committed by GitHub
parent 6aa019280b
commit 48a07a2970
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -295,6 +295,8 @@ class Feature:
if self.precision_hint is not None and isinstance(value, float):
value = round(value, self.precision_hint)
if isinstance(value, Enum):
value = repr(value)
s = f"{self.name} ({self.id}): {value}"
if self.unit is not None:
s += f" {self.unit}"