Skip to content

Commit bbc57b8

Browse files
danieldotnlclaude
andcommitted
Migrate to StrEnum to fix ruff UP042
Replace `class Foo(str, Enum)` with `class Foo(StrEnum)` for MeterType and SensorState, fixing the new UP042 lint rule in ruff 0.15. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fa33ed8 commit bbc57b8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

custom_components/measureit/const.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Constants for MeasureIt."""
22

3-
from enum import Enum
3+
from enum import StrEnum
44
from logging import Logger, getLogger
55

66
LOGGER: Logger = getLogger(__package__)
@@ -58,15 +58,15 @@
5858
}
5959

6060

61-
class MeterType(str, Enum):
61+
class MeterType(StrEnum):
6262
"""Enum with possible meter states."""
6363

6464
TIME = "time"
6565
SOURCE = "source"
6666
COUNTER = "counter"
6767

6868

69-
class SensorState(str, Enum):
69+
class SensorState(StrEnum):
7070
"""Enum with possible meter states."""
7171

7272
INITIALIZING_SOURCE = "initializing source value"

0 commit comments

Comments
 (0)