This repository has been archived by the owner on Mar 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use WaterAmount in WaterInfoEventDto (#95)
* use WaterAmount in WaterInfoEventDto * fix equal of DisplayNameIntEnum * fix pylint
- Loading branch information
Showing
12 changed files
with
68 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
"""Base event module.""" | ||
|
||
|
||
class EventDto: | ||
"""Event base class.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Water info event module.""" | ||
from dataclasses import dataclass | ||
|
||
from deebotozmo.util import DisplayNameIntEnum | ||
|
||
from .base import EventDto | ||
|
||
|
||
class WaterAmount(DisplayNameIntEnum): | ||
"""Enum class for all possible water amounts.""" | ||
|
||
LOW = 1 | ||
MEDIUM = 2 | ||
HIGH = 3 | ||
ULTRAHIGH = 4 | ||
|
||
|
||
@dataclass(frozen=True) | ||
class WaterInfoEventDto(EventDto): | ||
"""Water info event representation.""" | ||
|
||
mop_attached: bool | ||
amount: WaterAmount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from deebotozmo.events import WaterAmount | ||
from tests.helpers import verify_DisplayNameEnum_unique | ||
|
||
|
||
def test_WaterLevel_unique(): | ||
verify_DisplayNameEnum_unique(WaterAmount) | ||
|
File renamed without changes.