Skip to content

Commit

Permalink
Fix LifeSpan enum (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhaus authored Dec 20, 2024
1 parent 0238549 commit 95a1590
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion deebot_client/events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class LifeSpan(StrEnum):
xml_value: str

def __new__(cls, value: str, xml_value: str = "") -> Self:
obj = str.__new__(cls)
obj = str.__new__(cls, value)
obj._value_ = value
obj.xml_value = xml_value
return obj
Expand Down
11 changes: 11 additions & 0 deletions tests/events/test_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""Test events."""

from __future__ import annotations

from deebot_client.events import LifeSpan


def test_life_span() -> None:
"""Test life span events."""
assert LifeSpan.BRUSH != LifeSpan.FILTER
assert LifeSpan.FILTER not in {LifeSpan.BLADE, LifeSpan.BRUSH, LifeSpan.SIDE_BRUSH}

0 comments on commit 95a1590

Please sign in to comment.